diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2022-11-13 10:42:15 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-13 10:42:15 -0500 |
commit | 2063ed7385712290d5f8e011145a58f7c95737e8 (patch) | |
tree | ea9ed19d5104fdcea44d0014f0b00770d523121b /cli/tests | |
parent | f81ad0b7c2ba85eeb99535189a6617af6488ff88 (diff) |
feat(npm): require --unstable for npm specifiers in remote modules (#16612)
Diffstat (limited to 'cli/tests')
4 files changed, 13 insertions, 0 deletions
diff --git a/cli/tests/integration/npm_tests.rs b/cli/tests/integration/npm_tests.rs index ced9ad8a3..07460d990 100644 --- a/cli/tests/integration/npm_tests.rs +++ b/cli/tests/integration/npm_tests.rs @@ -179,6 +179,14 @@ itest!(sub_paths { http_server: true, }); +itest!(remote_npm_specifier { + args: "run --quiet npm/remote_npm_specifier/main.ts", + output: "npm/remote_npm_specifier/main.out", + envs: env_vars(), + http_server: true, + exit_code: 1, +}); + itest!(tarball_with_global_header { args: "run -A --quiet npm/tarball_with_global_header/main.js", output: "npm/tarball_with_global_header/main.out", diff --git a/cli/tests/testdata/npm/remote_npm_specifier/main.out b/cli/tests/testdata/npm/remote_npm_specifier/main.out new file mode 100644 index 000000000..0cb08b7bc --- /dev/null +++ b/cli/tests/testdata/npm/remote_npm_specifier/main.out @@ -0,0 +1 @@ +error: importing npm specifiers in remote modules requires the --unstable flag (referrer: http://localhost:4545/npm/remote_npm_specifier/remote.ts) diff --git a/cli/tests/testdata/npm/remote_npm_specifier/main.ts b/cli/tests/testdata/npm/remote_npm_specifier/main.ts new file mode 100644 index 000000000..20a99b688 --- /dev/null +++ b/cli/tests/testdata/npm/remote_npm_specifier/main.ts @@ -0,0 +1 @@ +import "http://localhost:4545/npm/remote_npm_specifier/remote.ts"; diff --git a/cli/tests/testdata/npm/remote_npm_specifier/remote.ts b/cli/tests/testdata/npm/remote_npm_specifier/remote.ts new file mode 100644 index 000000000..923ed3ed8 --- /dev/null +++ b/cli/tests/testdata/npm/remote_npm_specifier/remote.ts @@ -0,0 +1,3 @@ +import chalk from "npm:chalk"; + +console.log(chalk.green("test")); |