summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/error_local_static_import_from_remote.js1
-rw-r--r--cli/tests/error_local_static_import_from_remote.js.out2
-rw-r--r--cli/tests/error_local_static_import_from_remote.ts1
-rw-r--r--cli/tests/error_local_static_import_from_remote.ts.out9
-rw-r--r--cli/tests/integration_tests.rs16
5 files changed, 29 insertions, 0 deletions
diff --git a/cli/tests/error_local_static_import_from_remote.js b/cli/tests/error_local_static_import_from_remote.js
new file mode 100644
index 000000000..eb7fd23ba
--- /dev/null
+++ b/cli/tests/error_local_static_import_from_remote.js
@@ -0,0 +1 @@
+import "file:///some/dir/file.js";
diff --git a/cli/tests/error_local_static_import_from_remote.js.out b/cli/tests/error_local_static_import_from_remote.js.out
new file mode 100644
index 000000000..99e4b94c7
--- /dev/null
+++ b/cli/tests/error_local_static_import_from_remote.js.out
@@ -0,0 +1,2 @@
+[WILDCARD]
+Remote module are not allowed to statically import local modules. Use dynamic import instead.
diff --git a/cli/tests/error_local_static_import_from_remote.ts b/cli/tests/error_local_static_import_from_remote.ts
new file mode 100644
index 000000000..a831db0c4
--- /dev/null
+++ b/cli/tests/error_local_static_import_from_remote.ts
@@ -0,0 +1 @@
+import "file:///some/dir/file.ts";
diff --git a/cli/tests/error_local_static_import_from_remote.ts.out b/cli/tests/error_local_static_import_from_remote.ts.out
new file mode 100644
index 000000000..de20b9d81
--- /dev/null
+++ b/cli/tests/error_local_static_import_from_remote.ts.out
@@ -0,0 +1,9 @@
+[WILDCARD]
+error: Uncaught PermissionDenied: Remote module are not allowed to statically import local modules. Use dynamic import instead.
+ at unwrapResponse ($deno$/ops/dispatch_json.ts:[WILDCARD])
+ at Object.sendAsync ($deno$/ops/dispatch_json.ts:[WILDCARD])
+ at async processImports ($deno$/compiler/imports.ts:[WILDCARD])
+ at async Object.processImports ($deno$/compiler/imports.ts:[WILDCARD])
+ at async compile ([WILDCARD]compiler.ts:[WILDCARD])
+ at async tsCompilerOnMessage ([WILDCARD]compiler.ts:[WILDCARD])
+ at async workerMessageRecvCallback ($deno$/runtime_worker.ts:[WILDCARD])
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs
index fbaab7674..7827d386a 100644
--- a/cli/tests/integration_tests.rs
+++ b/cli/tests/integration_tests.rs
@@ -1422,6 +1422,22 @@ itest!(error_type_definitions {
output: "error_type_definitions.ts.out",
});
+itest!(error_local_static_import_from_remote_ts {
+ args: "run --reload http://localhost:4545/cli/tests/error_local_static_import_from_remote.ts",
+ check_stderr: true,
+ exit_code: 1,
+ http_server: true,
+ output: "error_local_static_import_from_remote.ts.out",
+});
+
+itest!(error_local_static_import_from_remote_js {
+ args: "run --reload http://localhost:4545/cli/tests/error_local_static_import_from_remote.js",
+ check_stderr: true,
+ exit_code: 1,
+ http_server: true,
+ output: "error_local_static_import_from_remote.js.out",
+});
+
// TODO(bartlomieju) Re-enable
itest_ignore!(error_worker_dynamic {
args: "run --reload error_worker_dynamic.ts",