summaryrefslogtreecommitdiff
path: root/cli/tests/workers_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/workers_test.ts')
-rw-r--r--cli/tests/workers_test.ts18
1 files changed, 18 insertions, 0 deletions
diff --git a/cli/tests/workers_test.ts b/cli/tests/workers_test.ts
index 395b1da24..06349efa0 100644
--- a/cli/tests/workers_test.ts
+++ b/cli/tests/workers_test.ts
@@ -106,6 +106,24 @@ Deno.test({
});
Deno.test({
+ name: "worker globals",
+ fn: async function (): Promise<void> {
+ const promise = createResolvable();
+ const w = new Worker(
+ new URL("subdir/worker_globals.ts", import.meta.url).href,
+ { type: "module" },
+ );
+ w.onmessage = (e): void => {
+ assertEquals(e.data, "true, true, true");
+ promise.resolve();
+ };
+ w.postMessage("Hello, world!");
+ await promise;
+ w.terminate();
+ },
+});
+
+Deno.test({
name: "worker fetch API",
fn: async function (): Promise<void> {
const promise = createResolvable();