mirror of
https://github.com/denoland/deno.git
synced 2024-11-01 09:24:20 -04:00
14 lines
329 B
TypeScript
14 lines
329 B
TypeScript
|
import { deferred } from "../../../test_util/std/async/deferred.ts";
|
||
|
|
||
|
const worker = new Worker(
|
||
|
new URL("set_exit_code_worker.js", import.meta.url).href,
|
||
|
{ type: "module", deno: { namespace: true } },
|
||
|
);
|
||
|
|
||
|
const promise1 = deferred();
|
||
|
worker.onmessage = (_e) => {
|
||
|
promise1.resolve();
|
||
|
};
|
||
|
await promise1;
|
||
|
worker.terminate();
|