()
| 949 | |
| 950 | #[test] |
| 951 | fn copy_expected_specifier_unnamed_version_string() { |
| 952 | let mut file = file_from_raw("{\"name\": \"pkg\", \"engines\": {\"node\": \">=16\"}}"); |
| 953 | let dep_type = DependencyType { |
| 954 | name_path: None, |
| 955 | name: "node".to_string(), |
| 956 | path: "/engines/node".to_string(), |
| 957 | strategy: Strategy::UnnamedVersionString, |
| 958 | source: SourceKind::PackageJson, |
| 959 | is_catalog_definition: false, |
| 960 | }; |
| 961 | let instance = make_instance("node", dep_type, ">=18"); |
| 962 | copy_expected_specifier_json(&mut file, &instance); |
| 963 | assert!(file.dirty); |
| 964 | assert_eq!(file.contents.pointer("/engines/node"), Some(&json!(">=18"))); |
| 965 | } |
| 966 | |
| 967 | #[test] |
| 968 | fn parse_json_file_returns_none_for_invalid_json() { |
nothing calls this directly
no test coverage detected
searching dependent graphs…