mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 10:59:13 +00:00
fix(npm): resolve node_modules dir relative to package.json instead of cwd (#17885)
This commit is contained in:
parent
a31d8869ea
commit
ddc350780d
12 changed files with 219 additions and 141 deletions
|
@ -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,
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue