diff options
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/integration/npm_tests.rs | 10 | ||||
-rw-r--r-- | cli/tests/testdata/npm/nonexistent_file/main.js | 3 | ||||
-rw-r--r-- | cli/tests/testdata/npm/nonexistent_file/main.out | 2 |
3 files changed, 13 insertions, 2 deletions
diff --git a/cli/tests/integration/npm_tests.rs b/cli/tests/integration/npm_tests.rs index 6da402a38..82f73be08 100644 --- a/cli/tests/integration/npm_tests.rs +++ b/cli/tests/integration/npm_tests.rs @@ -286,6 +286,16 @@ itest!(nonexistent_file { exit_code: 1, }); +itest!(nonexistent_file_node_modules_dir { + // there was a bug where the message was different when using a node_modules dir + args: "run -A --quiet --node-modules-dir npm/nonexistent_file/main.js", + output: "npm/nonexistent_file/main.out", + copy_temp_dir: Some("npm/nonexistent_file/"), + envs: env_vars_for_npm_tests(), + http_server: true, + exit_code: 1, +}); + itest!(invalid_package_name { args: "run -A --quiet npm/invalid_package_name/main.js", output: "npm/invalid_package_name/main.out", diff --git a/cli/tests/testdata/npm/nonexistent_file/main.js b/cli/tests/testdata/npm/nonexistent_file/main.js index 4e4657088..c480b0548 100644 --- a/cli/tests/testdata/npm/nonexistent_file/main.js +++ b/cli/tests/testdata/npm/nonexistent_file/main.js @@ -1 +1,2 @@ -import hmacSHA512 from "npm:crypto-js/hmac-sha512"; +import hmacSHA512 from "npm:crypto-js/non-existent"; +console.log(hmacSHA512); diff --git a/cli/tests/testdata/npm/nonexistent_file/main.out b/cli/tests/testdata/npm/nonexistent_file/main.out index 5f43f7242..baa79b1ce 100644 --- a/cli/tests/testdata/npm/nonexistent_file/main.out +++ b/cli/tests/testdata/npm/nonexistent_file/main.out @@ -1,4 +1,4 @@ -error: Unable to load [WILDCARD]hmac-sha512 imported from [WILDCARD]/testdata/npm/nonexistent_file/main.js +error: Unable to load [WILDCARD]non-existent imported from [WILDCARD]main.js Caused by: [WILDCARD] |