From 9bdc9e4ecb7227c80384206f6d7f869f183e4525 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 6 Dec 2023 14:24:00 -0500 Subject: fix(npm): do not create symlink for non-system optional dep in node_modules directory (#21478) Closes https://github.com/denoland/deno/issues/21476 --- cli/tests/integration/npm_tests.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'cli/tests/integration') diff --git a/cli/tests/integration/npm_tests.rs b/cli/tests/integration/npm_tests.rs index fe3e6cd0f..9ac4efc4a 100644 --- a/cli/tests/integration/npm_tests.rs +++ b/cli/tests/integration/npm_tests.rs @@ -2009,6 +2009,15 @@ fn binary_package_with_optional_dependencies() { assert!(!project_path .join("node_modules/.deno/@denotest+binary-package-mac@1.0.0") .exists()); + assert!(project_path + .join("node_modules/.deno/@denotest+binary-package@1.0.0/node_modules/@denotest/binary-package-windows") + .exists()); + assert!(!project_path + .join("node_modules/.deno/@denotest+binary-package@1.0.0/node_modules/@denotest/binary-package-linux") + .exists()); + assert!(!project_path + .join("node_modules/.deno/@denotest+binary-package@1.0.0/node_modules/@denotest/binary-package-mac") + .exists()); } #[cfg(target_os = "macos")] @@ -2027,6 +2036,15 @@ fn binary_package_with_optional_dependencies() { assert!(project_path .join("node_modules/.deno/@denotest+binary-package-mac@1.0.0") .exists()); + assert!(!project_path + .join("node_modules/.deno/@denotest+binary-package@1.0.0/node_modules/@denotest/binary-package-windows") + .exists()); + assert!(!project_path + .join("node_modules/.deno/@denotest+binary-package@1.0.0/node_modules/@denotest/binary-package-linux") + .exists()); + assert!(project_path + .join("node_modules/.deno/@denotest+binary-package@1.0.0/node_modules/@denotest/binary-package-mac") + .exists()); } #[cfg(target_os = "linux")] @@ -2044,6 +2062,15 @@ fn binary_package_with_optional_dependencies() { assert!(!project_path .join("node_modules/.deno/@denotest+binary-package-mac@1.0.0") .exists()); + assert!(!project_path + .join("node_modules/.deno/@denotest+binary-package@1.0.0/node_modules/@denotest/binary-package-windows") + .exists()); + assert!(project_path + .join("node_modules/.deno/@denotest+binary-package@1.0.0/node_modules/@denotest/binary-package-linux") + .exists()); + assert!(!project_path + .join("node_modules/.deno/@denotest+binary-package@1.0.0/node_modules/@denotest/binary-package-mac") + .exists()); } } } -- cgit v1.2.3