mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 07:14:47 -05:00
parent
ff9ff4a377
commit
b837fc300d
2 changed files with 6 additions and 0 deletions
|
@ -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);
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue