summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/testdata/run/import_meta/importmap.json3
-rw-r--r--cli/tests/testdata/run/import_meta/main.out5
-rw-r--r--cli/tests/testdata/run/import_meta/main.ts17
3 files changed, 17 insertions, 8 deletions
diff --git a/cli/tests/testdata/run/import_meta/importmap.json b/cli/tests/testdata/run/import_meta/importmap.json
index f8c056afd..d85fe3028 100644
--- a/cli/tests/testdata/run/import_meta/importmap.json
+++ b/cli/tests/testdata/run/import_meta/importmap.json
@@ -6,6 +6,7 @@
"1": "https://example.com/PASS-1",
"null": "https://example.com/PASS-null",
"undefined": "https://example.com/PASS-undefined",
- "[object Object]": "https://example.com/PASS-object"
+ "[object Object]": "https://example.com/PASS-object",
+ "npm:preact": "https://example.com/preact"
}
}
diff --git a/cli/tests/testdata/run/import_meta/main.out b/cli/tests/testdata/run/import_meta/main.out
index 1b51f1cdf..0329dea8a 100644
--- a/cli/tests/testdata/run/import_meta/main.out
+++ b/cli/tests/testdata/run/import_meta/main.out
@@ -7,5 +7,6 @@ Resolving without a value from import map https://example.com/PASS-undefined
Resolving 1 from import map https://example.com/PASS-1
Resolving null from import map https://example.com/PASS-null
Resolving object from import map https://example.com/PASS-object
-TypeError: "npm:" specifiers are currently not supported in import.meta.resolve()
- at file:///[WILDCARD]testdata/run/import_meta/main.ts:36:15
+Resolving npm:cowsay npm:cowsay
+Resolving npm:cowsay@1 npm:cowsay@1
+Resolving npm:preact from import map https://example.com/preact
diff --git a/cli/tests/testdata/run/import_meta/main.ts b/cli/tests/testdata/run/import_meta/main.ts
index b6d9c506e..96d63ba78 100644
--- a/cli/tests/testdata/run/import_meta/main.ts
+++ b/cli/tests/testdata/run/import_meta/main.ts
@@ -32,8 +32,15 @@ assertThrows(() => {
assertThrows(() => {
import.meta.resolve("://malformed/url?asdf");
}, TypeError);
-try {
- import.meta.resolve("npm:cowsay");
-} catch (e) {
- console.log(e);
-}
+console.log(
+ "Resolving npm:cowsay",
+ import.meta.resolve("npm:cowsay"),
+);
+console.log(
+ "Resolving npm:cowsay@1",
+ import.meta.resolve("npm:cowsay@1"),
+);
+console.log(
+ "Resolving npm:preact from import map",
+ import.meta.resolve("npm:preact"),
+);