diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-08-28 14:17:47 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-28 14:17:47 -0400 |
commit | b708a13eb02510925b5fd964fe933b4896093185 (patch) | |
tree | e20a84f95680439a3eb665245fc7ede27bf4be02 /tests/integration/run_tests.rs | |
parent | 7dd861aa36974d5afa9633078b51c4c7f17cf181 (diff) |
feat: improve lockfile v4 to store normalized version constraints and be more terse (#25247)
Stores normalized version constraints in the lockfile, which will
improve reproducibility and will fix a bug with duplicate specifiers
ending up in the lockfile. Also, gets rid of some duplicate data in the
specifiers area of the lockfile.
Diffstat (limited to 'tests/integration/run_tests.rs')
-rw-r--r-- | tests/integration/run_tests.rs | 54 |
1 files changed, 12 insertions, 42 deletions
diff --git a/tests/integration/run_tests.rs b/tests/integration/run_tests.rs index ad20b77e1..64e9d1c22 100644 --- a/tests/integration/run_tests.rs +++ b/tests/integration/run_tests.rs @@ -923,7 +923,7 @@ fn lock_redirects() { r#"{ "version": "4", "specifiers": { - "npm:@denotest/esm-basic": "npm:@denotest/esm-basic@1.0.0" + "npm:@denotest/esm-basic@*": "1.0.0" }, "npm": { "@denotest/esm-basic@1.0.0": { @@ -974,8 +974,8 @@ fn lock_deno_json_package_json_deps() { lockfile.assert_matches_json(json!({ "version": "4", "specifiers": { - "jsr:@denotest/module-graph@1.4": "jsr:@denotest/module-graph@1.4.0", - "npm:@denotest/esm-basic": "npm:@denotest/esm-basic@1.0.0" + "jsr:@denotest/module-graph@1.4": "1.4.0", + "npm:@denotest/esm-basic@*": "1.0.0" }, "jsr": { "@denotest/module-graph@1.4.0": { @@ -990,7 +990,7 @@ fn lock_deno_json_package_json_deps() { "workspace": { "dependencies": [ "jsr:@denotest/module-graph@1.4", - "npm:@denotest/esm-basic" + "npm:@denotest/esm-basic@*" ] } })); @@ -1022,8 +1022,8 @@ fn lock_deno_json_package_json_deps() { lockfile.assert_matches_json(json!({ "version": "4", "specifiers": { - "jsr:@denotest/module-graph@1.4": "jsr:@denotest/module-graph@1.4.0", - "npm:@denotest/esm-basic": "npm:@denotest/esm-basic@1.0.0" + "jsr:@denotest/module-graph@1.4": "1.4.0", + "npm:@denotest/esm-basic@*": "1.0.0" }, "jsr": { "@denotest/module-graph@1.4.0": { @@ -1041,7 +1041,7 @@ fn lock_deno_json_package_json_deps() { ], "packageJson": { "dependencies": [ - "npm:@denotest/esm-basic" + "npm:@denotest/esm-basic@*" ] } } @@ -1059,7 +1059,7 @@ fn lock_deno_json_package_json_deps() { lockfile.assert_matches_json(json!({ "version": "4", "specifiers": { - "jsr:@denotest/module-graph@1.4": "jsr:@denotest/module-graph@1.4.0", + "jsr:@denotest/module-graph@1.4": "1.4.0", }, "jsr": { "@denotest/module-graph@1.4.0": { @@ -1143,8 +1143,8 @@ fn lock_deno_json_package_json_deps_workspace() { lockfile.assert_matches_json(json!({ "version": "4", "specifiers": { - "npm:@denotest/cjs-default-export@1": "npm:@denotest/cjs-default-export@1.0.0", - "npm:@denotest/esm-basic@1": "npm:@denotest/esm-basic@1.0.0" + "npm:@denotest/cjs-default-export@1": "1.0.0", + "npm:@denotest/esm-basic@1": "1.0.0" }, "npm": { "@denotest/cjs-default-export@1.0.0": { @@ -1186,8 +1186,8 @@ fn lock_deno_json_package_json_deps_workspace() { let expected_lockfile = json!({ "version": "4", "specifiers": { - "npm:@denotest/cjs-default-export@1": "npm:@denotest/cjs-default-export@1.0.0", - "npm:@denotest/esm-basic@1": "npm:@denotest/esm-basic@1.0.0" + "npm:@denotest/cjs-default-export@1": "1.0.0", + "npm:@denotest/esm-basic@1": "1.0.0" }, "npm": { "@denotest/cjs-default-export@1.0.0": { @@ -3463,36 +3463,6 @@ fn package_json_with_deno_json() { } #[test] -fn package_json_error_dep_value_test() { - let context = TestContextBuilder::for_npm() - .use_copy_temp_dir("package_json/invalid_value") - .cwd("package_json/invalid_value") - .build(); - - // should run fine when not referencing a failing dep entry - context - .new_command() - .args("run ok.ts") - .run() - .assert_matches_file("package_json/invalid_value/ok.ts.out"); - - // should fail when referencing a failing dep entry - context - .new_command() - .args("run error.ts") - .run() - .assert_exit_code(1) - .assert_matches_file("package_json/invalid_value/error.ts.out"); - - // should output a warning about the failing dep entry - context - .new_command() - .args("task test") - .run() - .assert_matches_file("package_json/invalid_value/task.out"); -} - -#[test] fn package_json_no_node_modules_dir_created() { // it should not create a node_modules directory let context = TestContextBuilder::new() |