summaryrefslogtreecommitdiff
path: root/cli/tests/workers/test.ts
diff options
context:
space:
mode:
authorSatya Rohith <me@satyarohith.com>2021-04-20 19:56:31 +0530
committerGitHub <noreply@github.com>2021-04-20 16:26:31 +0200
commit15ffdd2624108f99960fc2da86e4f751e32bfd16 (patch)
tree2817ea0ad87a2fc3148380e4ee298e1fd1cc9cc3 /cli/tests/workers/test.ts
parent9e6cd91014ac4a0d34556b0d09cbe25e4e0930c6 (diff)
fix(runtime): include HTTP op in WebWorker (#10207)
Diffstat (limited to 'cli/tests/workers/test.ts')
-rw-r--r--cli/tests/workers/test.ts24
1 files changed, 24 insertions, 0 deletions
diff --git a/cli/tests/workers/test.ts b/cli/tests/workers/test.ts
index e5e9e44f7..72b87e398 100644
--- a/cli/tests/workers/test.ts
+++ b/cli/tests/workers/test.ts
@@ -697,3 +697,27 @@ Deno.test({
worker.terminate();
},
});
+
+Deno.test({
+ name: "Worker with native HTTP",
+ fn: async function () {
+ const worker = new Worker(
+ new URL(
+ "./http_worker.js",
+ import.meta.url,
+ ).href,
+ {
+ type: "module",
+ deno: {
+ namespace: true,
+ permissions: "inherit",
+ },
+ },
+ );
+
+ assert(worker);
+ const response = await fetch("http://localhost:4500");
+ assert(await response.arrayBuffer());
+ worker.terminate();
+ },
+});