1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 07:14:47 -05:00

fix(#10302): flaky worker test (#10303)

This commit is contained in:
Ryan Dahl 2021-04-21 22:02:11 -04:00 committed by GitHub
parent ff9ff4a377
commit b837fc300d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -1,5 +1,6 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
const listener = Deno.listen({ hostname: "127.0.0.1", port: 4500 });
postMessage("ready");
for await (const conn of listener) {
(async () => {
const requests = Deno.serveHttp(conn);

View file

@ -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");