diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-08-17 12:14:22 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-17 16:14:22 +0000 |
commit | f343391a9f97d29ad287f247c06aa370eb7cab50 (patch) | |
tree | eeed398c9506fde5c20d3e552edd8a432bc5a2ae /cli/tests/integration/run_tests.rs | |
parent | 6082e51094e0b5835d7c83586766cc611da2a382 (diff) |
fix(unstable): disable importing from the vendor directory (#20067)
Some people might get think they need to import from this directory,
which could cause confusion and duplicate dependencies. Additionally,
the `vendor` directory has special behaviour in the language server, so
importing from the folder will definitely cause confusion and issues
there.
Diffstat (limited to 'cli/tests/integration/run_tests.rs')
-rw-r--r-- | cli/tests/integration/run_tests.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs index 2ac6ed985..0c39c2b72 100644 --- a/cli/tests/integration/run_tests.rs +++ b/cli/tests/integration/run_tests.rs @@ -4580,4 +4580,17 @@ console.log(returnsHi());"#, .args("run --vendor http://localhost:4545/subdir/CAPITALS/hello_there.ts") .run() .assert_matches_text("hello there\n"); + + // now try importing directly from the vendor folder + temp_dir.write( + "main.ts", + r#"import { returnsHi } from './vendor/http_localhost_4545/subdir/mod1.ts'; +console.log(returnsHi());"#, + ); + deno_run_cmd + .run() + .assert_matches_text("error: Importing from the vendor directory is not permitted. Use a remote specifier instead or disable vendoring. + at [WILDCARD]/main.ts:1:27 +") + .assert_exit_code(1); } |