diff options
Diffstat (limited to 'cli/tests')
3 files changed, 24 insertions, 0 deletions
diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs index f30e7ce69..7dbf9c74c 100644 --- a/cli/tests/integration/run_tests.rs +++ b/cli/tests/integration/run_tests.rs @@ -2753,6 +2753,8 @@ itest!(package_json_auto_discovered_for_local_script_log { args: "run -L debug -A no_deno_json/main.ts", output: "run/with_package_json/no_deno_json/main.out", maybe_cwd: Some("run/with_package_json/"), + // prevent creating a node_modules dir in the code directory + copy_temp_dir: Some("run/with_package_json/"), envs: env_vars_for_npm_tests_no_sync_download(), http_server: true, }); @@ -2764,16 +2766,29 @@ itest!( args: "run -L debug with_stop/some/nested/dir/main.ts", output: "run/with_package_json/with_stop/main.out", maybe_cwd: Some("run/with_package_json/"), + copy_temp_dir: Some("run/with_package_json/"), envs: env_vars_for_npm_tests_no_sync_download(), http_server: true, exit_code: 1, } ); +itest!( + package_json_auto_discovered_node_modules_relative_package_json { + args: "run -A main.js", + output: "run/with_package_json/no_deno_json/sub_dir/main.out", + maybe_cwd: Some("run/with_package_json/no_deno_json/sub_dir"), + copy_temp_dir: Some("run/with_package_json/"), + envs: env_vars_for_npm_tests_no_sync_download(), + http_server: true, + } +); + itest!(package_json_auto_discovered_for_npm_binary { args: "run -L debug -A npm:@denotest/bin/cli-esm this is a test", output: "run/with_package_json/npm_binary/main.out", maybe_cwd: Some("run/with_package_json/npm_binary/"), + copy_temp_dir: Some("run/with_package_json/"), envs: env_vars_for_npm_tests_no_sync_download(), http_server: true, }); diff --git a/cli/tests/testdata/run/with_package_json/no_deno_json/sub_dir/main.js b/cli/tests/testdata/run/with_package_json/no_deno_json/sub_dir/main.js new file mode 100644 index 000000000..297653211 --- /dev/null +++ b/cli/tests/testdata/run/with_package_json/no_deno_json/sub_dir/main.js @@ -0,0 +1,2 @@ +console.log(Deno.cwd()); +console.log(Deno.statSync("../node_modules")); diff --git a/cli/tests/testdata/run/with_package_json/no_deno_json/sub_dir/main.out b/cli/tests/testdata/run/with_package_json/no_deno_json/sub_dir/main.out new file mode 100644 index 000000000..0ec791960 --- /dev/null +++ b/cli/tests/testdata/run/with_package_json/no_deno_json/sub_dir/main.out @@ -0,0 +1,7 @@ +Download http://[WILDCARD] +[WILDCARD]sub_dir +{ + [WILDCARD] + isDirectory: true, + [WILDCARD] +} |