diff options
Diffstat (limited to 'cli/tests/integration/npm_tests.rs')
-rw-r--r-- | cli/tests/integration/npm_tests.rs | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/cli/tests/integration/npm_tests.rs b/cli/tests/integration/npm_tests.rs index 9c4b98241..c46f8e92b 100644 --- a/cli/tests/integration/npm_tests.rs +++ b/cli/tests/integration/npm_tests.rs @@ -6,8 +6,7 @@ use test_util as util; use util::assert_contains; use util::http_server; -// NOTE: It's possible to automatically update the npm registry data in the test server -// by setting the DENO_TEST_UTIL_UPDATE_NPM=1 environment variable. +// NOTE: See how to make test npm packages at ../testdata/npm/README.md itest!(esm_module { args: "run --allow-read --unstable npm/esm/main.js", @@ -48,6 +47,13 @@ itest!(cjs_sub_path { http_server: true, }); +itest!(cjs_local_global_decls { + args: "run --allow-read --unstable npm/cjs_local_global_decls/main.ts", + output: "npm/cjs_local_global_decls/main.out", + envs: env_vars(), + http_server: true, +}); + itest!(dynamic_import { args: "run --allow-read --unstable npm/dynamic_import/main.ts", output: "npm/dynamic_import/main.out", @@ -238,12 +244,14 @@ fn ensure_registry_files_local() { let registry_json_path = registry_dir_path .join(entry.file_name()) .join("registry.json"); - let file_text = std::fs::read_to_string(®istry_json_path).unwrap(); - if file_text.contains("https://registry.npmjs.org/") { - panic!( - "file {} contained a reference to the npm registry", - registry_json_path.display(), - ); + if registry_json_path.exists() { + let file_text = std::fs::read_to_string(®istry_json_path).unwrap(); + if file_text.contains("https://registry.npmjs.org/") { + panic!( + "file {} contained a reference to the npm registry", + registry_json_path.display(), + ); + } } } } |