deno/cli/tests/039_worker_deno_ns.ts
Ryan Dahl 9cfdc60a23
Move integration tests to //cli/tests/ (#2964)
This ensures the deno executable is properly created before running the integration tests.

Also allows deno_cli to be used as a lib. Docs are now properly generated: https://docs.rs/deno_cli/0.18.4/deno_cli/

Towards #2933
Prep for #2955
2019-09-16 21:05:14 -04:00

25 lines
552 B
TypeScript

const w1 = new Worker("./039_worker_deno_ns/has_ns.ts");
const w2 = new Worker("./039_worker_deno_ns/no_ns.ts", {
noDenoNamespace: true
});
let w1MsgCount = 0;
let w2MsgCount = 0;
w1.onmessage = (msg): void => {
console.log(msg.data);
w1MsgCount++;
if (w1MsgCount === 1) {
w1.postMessage("CONTINUE");
} else {
w2.postMessage("START");
}
};
w2.onmessage = (msg): void => {
console.log(msg.data);
w2MsgCount++;
if (w2MsgCount === 1) {
w2.postMessage("CONTINUE");
} else {
Deno.exit(0);
}
};
w1.postMessage("START");