fix(task): do not eagerly auto-install packages in package.json when "nodeModulesDir": false (#21858)

There's no need to auto-install the package.json if the user is not
using a node_modules directory.

Closes #21850
This commit is contained in:
David Sherret 2024-01-08 19:30:36 -05:00 committed by GitHub
parent 0efb17b2cb
commit be888c068c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 33 additions and 4 deletions

View file

@ -178,6 +178,18 @@ itest!(task_package_json_npm_bin {
http_server: true,
});
// should not auto-install the packages in the package.json
// when using nodeModulesDir: false
itest!(task_package_json_node_modules_dir_false {
args: "task echo",
cwd: Some("task/package_json_node_modules_dir_false/"),
output: "task/package_json_node_modules_dir_false/bin.out",
copy_temp_dir: Some("task/package_json_node_modules_dir_false/"),
envs: env_vars_for_npm_tests(),
exit_code: 0,
http_server: true,
});
itest!(task_both_no_arg {
args: "task",
cwd: Some("task/both/"),