summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2020-11-06 12:10:19 +1100
committerGitHub <noreply@github.com>2020-11-06 12:10:19 +1100
commit5f7c80986fd9cff6a65d4e419fc2972abe992ccf (patch)
tree8bbee5a70b33539edb4c24d349e80f5383d7a79c
parent96e03e0b93bf75035887ce02880b832123e3c86d (diff)
fix(cli): correct libs sent to tsc for unstable worker (#8260)
Fixes #8257
-rw-r--r--cli/module_graph.rs2
-rw-r--r--cli/tests/integration_tests.rs5
-rw-r--r--cli/tests/subdir/worker_unstable.ts5
-rw-r--r--cli/tests/unstable_worker.ts10
-rw-r--r--cli/tests/unstable_worker.ts.out2
5 files changed, 23 insertions, 1 deletions
diff --git a/cli/module_graph.rs b/cli/module_graph.rs
index d757aa0a1..7a6d68086 100644
--- a/cli/module_graph.rs
+++ b/cli/module_graph.rs
@@ -551,7 +551,7 @@ impl Serialize for TypeLib {
vec!["deno.window".to_string(), "deno.unstable".to_string()]
}
TypeLib::UnstableDenoWorker => {
- vec!["deno.worker".to_string(), "deno.worker".to_string()]
+ vec!["deno.worker".to_string(), "deno.unstable".to_string()]
}
};
Serialize::serialize(&value, serializer)
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs
index 9c6c4eef2..6aa2c8a9d 100644
--- a/cli/tests/integration_tests.rs
+++ b/cli/tests/integration_tests.rs
@@ -2792,6 +2792,11 @@ itest!(unstable_disabled_ts2551 {
output: "unstable_disabled_ts2551.out",
});
+itest!(unstable_worker {
+ args: "run --reload --unstable --quiet --allow-read unstable_worker.ts",
+ output: "unstable_worker.ts.out",
+});
+
itest!(_053_import_compression {
args: "run --quiet --reload --allow-net 053_import_compression/main.ts",
output: "053_import_compression.out",
diff --git a/cli/tests/subdir/worker_unstable.ts b/cli/tests/subdir/worker_unstable.ts
new file mode 100644
index 000000000..3a1ed8b74
--- /dev/null
+++ b/cli/tests/subdir/worker_unstable.ts
@@ -0,0 +1,5 @@
+console.log(Deno.permissions.query);
+console.log(Deno.compile);
+self.onmessage = () => {
+ self.close();
+};
diff --git a/cli/tests/unstable_worker.ts b/cli/tests/unstable_worker.ts
new file mode 100644
index 000000000..6b5304edf
--- /dev/null
+++ b/cli/tests/unstable_worker.ts
@@ -0,0 +1,10 @@
+const w = new Worker(
+ new URL("subdir/worker_unstable.ts", import.meta.url).href,
+ {
+ type: "module",
+ deno: true,
+ name: "Unstable Worker",
+ },
+);
+
+w.postMessage({});
diff --git a/cli/tests/unstable_worker.ts.out b/cli/tests/unstable_worker.ts.out
new file mode 100644
index 000000000..cdbb7e911
--- /dev/null
+++ b/cli/tests/unstable_worker.ts.out
@@ -0,0 +1,2 @@
+[Function: query]
+[AsyncFunction: compile]