From dc1da309274823c15ad8ade0545678f8a9b8e54d Mon Sep 17 00:00:00 2001 From: await-ovo <13152410380@163.com> Date: Tue, 19 Sep 2023 04:02:58 +0800 Subject: fix(cli): for main-module that exists in package.json, use the version defined in package.json directly (#20328) --- cli/tests/integration/npm_tests.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'cli/tests/integration/npm_tests.rs') diff --git a/cli/tests/integration/npm_tests.rs b/cli/tests/integration/npm_tests.rs index edd100d7d..09330a80c 100644 --- a/cli/tests/integration/npm_tests.rs +++ b/cli/tests/integration/npm_tests.rs @@ -448,6 +448,27 @@ itest!(permissions_outside_package { http_server: true, }); +itest!(run_existing_npm_package { + args: "run --allow-read --node-modules-dir npm:@denotest/bin", + output: "npm/run_existing_npm_package/main.out", + envs: env_vars_for_npm_tests(), + http_server: true, + temp_cwd: true, + cwd: Some("npm/run_existing_npm_package/"), + copy_temp_dir: Some("npm/run_existing_npm_package/"), +}); + +itest!(run_existing_npm_package_with_subpath { + args: + "run --allow-read --node-modules-dir npm:@denotest/bin/cli-esm dev --help", + output: "npm/run_existing_npm_package_with_subpath/main.out", + envs: env_vars_for_npm_tests(), + http_server: true, + temp_cwd: true, + cwd: Some("npm/run_existing_npm_package_with_subpath/"), + copy_temp_dir: Some("npm/run_existing_npm_package_with_subpath/"), +}); + #[test] fn parallel_downloading() { let (out, _err) = util::run_and_collect_output_with_args( -- cgit v1.2.3