summaryrefslogtreecommitdiff
path: root/tests/specs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-06-11 08:55:12 -0400
committerGitHub <noreply@github.com>2024-06-11 08:55:12 -0400
commit4bc96c5d2ab46ff3ca1af1524c1913c2a5f2745c (patch)
tree8452947b0267e47c795cadb02d2d1b44b3e40f81 /tests/specs
parent6a356aff1380e79d67738c5b43aa2b5fee76600d (diff)
fix(npm): resolve dynamic npm imports individually (#24170)
* https://github.com/denoland/deno_npm/pull/57 * https://github.com/denoland/deno_graph/pull/498 Closes https://github.com/denoland/deno/issues/17802
Diffstat (limited to 'tests/specs')
-rw-r--r--tests/specs/npm/dynamic_npm_resolution_failure/__test__.jsonc4
-rw-r--r--tests/specs/npm/dynamic_npm_resolution_failure/main.out15
-rw-r--r--tests/specs/npm/dynamic_npm_resolution_failure/main.ts9
3 files changed, 28 insertions, 0 deletions
diff --git a/tests/specs/npm/dynamic_npm_resolution_failure/__test__.jsonc b/tests/specs/npm/dynamic_npm_resolution_failure/__test__.jsonc
new file mode 100644
index 000000000..f816bad86
--- /dev/null
+++ b/tests/specs/npm/dynamic_npm_resolution_failure/__test__.jsonc
@@ -0,0 +1,4 @@
+{
+ "args": "run -A main.ts",
+ "output": "main.out"
+}
diff --git a/tests/specs/npm/dynamic_npm_resolution_failure/main.out b/tests/specs/npm/dynamic_npm_resolution_failure/main.out
new file mode 100644
index 000000000..03c733567
--- /dev/null
+++ b/tests/specs/npm/dynamic_npm_resolution_failure/main.out
@@ -0,0 +1,15 @@
+[UNORDERED_START]
+Download http://localhost:4260/chalk
+Download http://localhost:4260/@denotest/dep-cannot-parse
+[UNORDERED_END]
+Download http://localhost:4260/chalk/chalk-5.0.1.tgz
+Hi
+TypeError: Error in @denotest/dep-cannot-parse@1.0.0 parsing version requirement for dependency: @denotest/esm-basic@unknown-scheme:unknown
+
+Invalid npm version requirement. Unexpected character.
+ unknown-scheme:unknown
+ ~
+ at async file:///[WILDLINE]main.ts:5:3 {
+ code: "ERR_MODULE_NOT_FOUND"
+}
+Bye
diff --git a/tests/specs/npm/dynamic_npm_resolution_failure/main.ts b/tests/specs/npm/dynamic_npm_resolution_failure/main.ts
new file mode 100644
index 000000000..0096bca48
--- /dev/null
+++ b/tests/specs/npm/dynamic_npm_resolution_failure/main.ts
@@ -0,0 +1,9 @@
+import chalk from "npm:chalk";
+
+console.log(chalk.green("Hi"));
+try {
+ await import("npm:@denotest/dep-cannot-parse");
+} catch (err) {
+ console.log(err);
+}
+console.log(chalk.green("Bye"));