summaryrefslogtreecommitdiff
path: root/cli/tests/workers/test.ts
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2021-04-21 22:02:11 -0400
committerGitHub <noreply@github.com>2021-04-21 22:02:11 -0400
commitb837fc300d5f31cf2628e81d59e388286493ce71 (patch)
tree232922f7f6adc5b57e4824d9cd5a75b071ef0c0b /cli/tests/workers/test.ts
parentff9ff4a3771689c56d557bf0dbeeb46a50d1adf2 (diff)
fix(#10302): flaky worker test (#10303)
Diffstat (limited to 'cli/tests/workers/test.ts')
-rw-r--r--cli/tests/workers/test.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/cli/tests/workers/test.ts b/cli/tests/workers/test.ts
index 72b87e398..c3ccebfbb 100644
--- a/cli/tests/workers/test.ts
+++ b/cli/tests/workers/test.ts
@@ -701,6 +701,7 @@ Deno.test({
Deno.test({
name: "Worker with native HTTP",
fn: async function () {
+ const result = deferred();
const worker = new Worker(
new URL(
"./http_worker.js",
@@ -714,6 +715,10 @@ Deno.test({
},
},
);
+ worker.onmessage = () => {
+ result.resolve();
+ };
+ await result;
assert(worker);
const response = await fetch("http://localhost:4500");