summaryrefslogtreecommitdiff
path: root/cli/tests/testdata
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/testdata')
-rw-r--r--cli/tests/testdata/publish/invalid_import.out32
-rw-r--r--cli/tests/testdata/publish/invalid_import/deno.json10
-rw-r--r--cli/tests/testdata/publish/invalid_import/mod.ts9
-rw-r--r--cli/tests/testdata/publish/symlink.out1
4 files changed, 52 insertions, 0 deletions
diff --git a/cli/tests/testdata/publish/invalid_import.out b/cli/tests/testdata/publish/invalid_import.out
new file mode 100644
index 000000000..ca9d20eed
--- /dev/null
+++ b/cli/tests/testdata/publish/invalid_import.out
@@ -0,0 +1,32 @@
+Download http://localhost:4545/welcome.ts
+Download http://localhost:4545/echo.ts
+Download http://localhost:4545/npm/registry/chalk
+Download http://localhost:4545/npm/registry/chalk/chalk-5.0.1.tgz
+Checking fast check type graph for errors...
+Ensuring type checks...
+Check file://[WILDCARD]mod.ts
+error[invalid-external-import]: invalid import to a non-JSR 'http' specifier
+ --> [WILDCARD]mod.ts:1:8
+ |
+1 | import "http://localhost:4545/welcome.ts";
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the specifier
+ = hint: replace this import with one from jsr or npm, or vendor the dependency into your package
+
+ info: the import was resolved to 'http://localhost:4545/welcome.ts'
+ info: this specifier is not allowed to be imported on jsr
+ info: jsr only supports importing `jsr:`, `npm:`, and `data:` specifiers
+ docs: https://jsr.io/go/invalid-external-import
+
+error[invalid-external-import]: invalid import to a non-JSR 'http' specifier
+ --> [WILDCARD]mod.ts:2:8
+ |
+2 | import "$echo";
+ | ^^^^^^^ the specifier
+ = hint: replace this import with one from jsr or npm, or vendor the dependency into your package
+
+ info: the import was resolved to 'http://localhost:4545/echo.ts'
+ info: this specifier is not allowed to be imported on jsr
+ info: jsr only supports importing `jsr:`, `npm:`, and `data:` specifiers
+ docs: https://jsr.io/go/invalid-external-import
+
+error: Found 2 problems
diff --git a/cli/tests/testdata/publish/invalid_import/deno.json b/cli/tests/testdata/publish/invalid_import/deno.json
new file mode 100644
index 000000000..49b666d22
--- /dev/null
+++ b/cli/tests/testdata/publish/invalid_import/deno.json
@@ -0,0 +1,10 @@
+{
+ "name": "@foo/bar",
+ "version": "1.0.0",
+ "imports": {
+ "$echo": "http://localhost:4545/echo.ts"
+ },
+ "exports": {
+ ".": "./mod.ts"
+ }
+}
diff --git a/cli/tests/testdata/publish/invalid_import/mod.ts b/cli/tests/testdata/publish/invalid_import/mod.ts
new file mode 100644
index 000000000..bdaf010e2
--- /dev/null
+++ b/cli/tests/testdata/publish/invalid_import/mod.ts
@@ -0,0 +1,9 @@
+import "http://localhost:4545/welcome.ts";
+import "$echo";
+
+import "data:application/javascript,console.log(1)";
+import "npm:chalk@5";
+
+export function foobar(): string {
+ return "string";
+}
diff --git a/cli/tests/testdata/publish/symlink.out b/cli/tests/testdata/publish/symlink.out
index 5befec4f9..d226fa18e 100644
--- a/cli/tests/testdata/publish/symlink.out
+++ b/cli/tests/testdata/publish/symlink.out
@@ -7,5 +7,6 @@ warning[unsupported-file-type]: unsupported file type 'symlink'
info: only files and directories are supported
info: the file was ignored and will not be published
+ docs: https://jsr.io/go/unsupported-file-type
Warning Aborting due to --dry-run