summaryrefslogtreecommitdiff
path: root/tests/specs/jsr/import_https_url
diff options
context:
space:
mode:
Diffstat (limited to 'tests/specs/jsr/import_https_url')
-rw-r--r--tests/specs/jsr/import_https_url/__test__.jsonc13
-rw-r--r--tests/specs/jsr/import_https_url/analyzable.out8
-rw-r--r--tests/specs/jsr/import_https_url/analyzable.ts1
-rw-r--r--tests/specs/jsr/import_https_url/nonanalyzable.out7
-rw-r--r--tests/specs/jsr/import_https_url/nonanalyzable.ts1
5 files changed, 30 insertions, 0 deletions
diff --git a/tests/specs/jsr/import_https_url/__test__.jsonc b/tests/specs/jsr/import_https_url/__test__.jsonc
new file mode 100644
index 000000000..597b8e009
--- /dev/null
+++ b/tests/specs/jsr/import_https_url/__test__.jsonc
@@ -0,0 +1,13 @@
+{
+ "base": "jsr",
+ "steps": [{
+ "args": "run -A analyzable.ts",
+ "output": "analyzable.out",
+ "exitCode": 1
+ }, {
+ "cleanDenoDir": true,
+ "args": "run -A nonanalyzable.ts",
+ "output": "nonanalyzable.out",
+ "exitCode": 1
+ }]
+}
diff --git a/tests/specs/jsr/import_https_url/analyzable.out b/tests/specs/jsr/import_https_url/analyzable.out
new file mode 100644
index 000000000..dd1ca58b4
--- /dev/null
+++ b/tests/specs/jsr/import_https_url/analyzable.out
@@ -0,0 +1,8 @@
+Download http://127.0.0.1:4250/@denotest/import-https-url/meta.json
+Download http://127.0.0.1:4250/@denotest/import-https-url/1.0.0_meta.json
+Download http://127.0.0.1:4250/@denotest/import-https-url/1.0.0/analyzable.ts
+Download http://localhost:4545/welcome.ts
+error: Uncaught (in promise) TypeError: Importing http://localhost:4545/welcome.ts blocked. JSR packages cannot import non-JSR remote modules for security reasons.
+await import("http://localhost:4545/welcome.ts");
+^
+ at async http://127.0.0.1:4250/@denotest/import-https-url/1.0.0/analyzable.ts:1:1
diff --git a/tests/specs/jsr/import_https_url/analyzable.ts b/tests/specs/jsr/import_https_url/analyzable.ts
new file mode 100644
index 000000000..44382867f
--- /dev/null
+++ b/tests/specs/jsr/import_https_url/analyzable.ts
@@ -0,0 +1 @@
+import "jsr:@denotest/import-https-url/analyzable";
diff --git a/tests/specs/jsr/import_https_url/nonanalyzable.out b/tests/specs/jsr/import_https_url/nonanalyzable.out
new file mode 100644
index 000000000..4ae04996c
--- /dev/null
+++ b/tests/specs/jsr/import_https_url/nonanalyzable.out
@@ -0,0 +1,7 @@
+Download http://127.0.0.1:4250/@denotest/import-https-url/meta.json
+Download http://127.0.0.1:4250/@denotest/import-https-url/1.0.0_meta.json
+Download http://127.0.0.1:4250/@denotest/import-https-url/1.0.0/unanalyzable.ts
+error: Uncaught (in promise) TypeError: Importing http://localhost:4545/welcome.ts blocked. JSR packages cannot import non-JSR remote modules for security reasons.
+await import(nonAnalyzableUrl());
+^
+ at async http://127.0.0.1:4250/@denotest/import-https-url/1.0.0/unanalyzable.ts:5:1
diff --git a/tests/specs/jsr/import_https_url/nonanalyzable.ts b/tests/specs/jsr/import_https_url/nonanalyzable.ts
new file mode 100644
index 000000000..87ccdcfdc
--- /dev/null
+++ b/tests/specs/jsr/import_https_url/nonanalyzable.ts
@@ -0,0 +1 @@
+import "jsr:@denotest/import-https-url/unanalyzable";