1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-24 08:09:08 -05:00
denoland-deno/cli/tests/workers_basic.ts

12 lines
259 B
TypeScript
Raw Normal View History

// Tests basic postMessage, close, onmessage
const jsWorker = new Worker("./subdir/test_worker_basic.js", {
type: "module",
name: "jsWorker"
});
jsWorker.onmessage = (e): void => {
console.log("main recv: " + e.data);
};
jsWorker.postMessage("msg1");