summaryrefslogtreecommitdiff
path: root/cli/tests/testdata
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-05-27 10:33:15 -0400
committerGitHub <noreply@github.com>2023-05-27 10:33:15 -0400
commita96844118c24d870abfe5332547dab99dc53d09c (patch)
tree194bde1661ad66e41efc912ccbb151edf268c643 /cli/tests/testdata
parentbe59e93220e24a2e66ae2843a136e61eab9d8ac3 (diff)
fix(compile): inline symlinks as files outside node_modules dir and warn for directories (#19285)
If a symlink within the `node_modules` directory lies outside that directory, it will now warn and inline the file. For directories, it will just warn for now. Probably fixes #19251 (I'm still unable to reproduce).
Diffstat (limited to 'cli/tests/testdata')
-rw-r--r--cli/tests/testdata/compile/node_modules_symlink_outside/main.out2
-rw-r--r--cli/tests/testdata/compile/node_modules_symlink_outside/main.ts6
-rw-r--r--cli/tests/testdata/compile/node_modules_symlink_outside/main_compile_file.out2
-rw-r--r--cli/tests/testdata/compile/node_modules_symlink_outside/main_compile_folder.out6
4 files changed, 16 insertions, 0 deletions
diff --git a/cli/tests/testdata/compile/node_modules_symlink_outside/main.out b/cli/tests/testdata/compile/node_modules_symlink_outside/main.out
new file mode 100644
index 000000000..61c83cba4
--- /dev/null
+++ b/cli/tests/testdata/compile/node_modules_symlink_outside/main.out
@@ -0,0 +1,2 @@
+4
+5
diff --git a/cli/tests/testdata/compile/node_modules_symlink_outside/main.ts b/cli/tests/testdata/compile/node_modules_symlink_outside/main.ts
new file mode 100644
index 000000000..45f681f7c
--- /dev/null
+++ b/cli/tests/testdata/compile/node_modules_symlink_outside/main.ts
@@ -0,0 +1,6 @@
+import { getValue, setValue } from "npm:@denotest/esm-basic";
+
+setValue(4);
+
+console.log(getValue());
+console.log(Deno.readTextFileSync("./node_modules/test.txt"));
diff --git a/cli/tests/testdata/compile/node_modules_symlink_outside/main_compile_file.out b/cli/tests/testdata/compile/node_modules_symlink_outside/main_compile_file.out
new file mode 100644
index 000000000..7602a4002
--- /dev/null
+++ b/cli/tests/testdata/compile/node_modules_symlink_outside/main_compile_file.out
@@ -0,0 +1,2 @@
+Compile file:///[WILDCARD]/node_modules_symlink_outside/main.ts to [WILDCARD]
+Symlink target is outside '[WILDCARD]node_modules_symlink_outside[WILDCARD]node_modules'. Inlining symlink at '[WILDCARD]node_modules_symlink_outside[WILDCARD]node_modules[WILDCARD]test.txt' to '[WILDCARD]node_modules_symlink_outside[WILDCARD]test.txt' as file.
diff --git a/cli/tests/testdata/compile/node_modules_symlink_outside/main_compile_folder.out b/cli/tests/testdata/compile/node_modules_symlink_outside/main_compile_folder.out
new file mode 100644
index 000000000..883a3f262
--- /dev/null
+++ b/cli/tests/testdata/compile/node_modules_symlink_outside/main_compile_folder.out
@@ -0,0 +1,6 @@
+Download http://localhost:4545/npm/registry/@denotest/esm-basic
+Download http://localhost:4545/npm/registry/@denotest/esm-basic/1.0.0.tgz
+Initialize @denotest/esm-basic@1.0.0
+Check file:///[WILDCARD]/node_modules_symlink_outside/main.ts
+Compile file:///[WILDCARD]/node_modules_symlink_outside/main.ts to [WILDCARD]
+Symlink target is outside '[WILDCARD]node_modules_symlink_outside[WILDCARD]node_modules'. Excluding symlink at '[WILDCARD]node_modules_symlink_outside[WILDCARD]node_modules[WILDCARD]some_folder' with target '[WILDCARD]node_modules_symlink_outside[WILDCARD]some_folder'.