diff options
| author | Satya Rohith <me@satyarohith.com> | 2024-05-03 11:22:47 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-03 05:52:47 +0000 |
| commit | 02d0ff58d2bab24ebbd1e61afe6b571ff4c415af (patch) | |
| tree | 78b7fa4e7cf0265d688e34ddaa422ec344273e06 /tests/testdata/workers/node_worker_auto_exits.mjs | |
| parent | 3e98ea4e69732d8a659ca0ca61747fe3887ab673 (diff) | |
refactor(tests): move worker_threads itests to spec tests (#23648)
Diffstat (limited to 'tests/testdata/workers/node_worker_auto_exits.mjs')
| -rw-r--r-- | tests/testdata/workers/node_worker_auto_exits.mjs | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/tests/testdata/workers/node_worker_auto_exits.mjs b/tests/testdata/workers/node_worker_auto_exits.mjs deleted file mode 100644 index e434f59f7..000000000 --- a/tests/testdata/workers/node_worker_auto_exits.mjs +++ /dev/null @@ -1,19 +0,0 @@ -import { isMainThread, parentPort, Worker } from "node:worker_threads"; - -function onMessageOneshot() { - console.log("Got message from main thread!"); - parentPort.off("message", onMessageOneshot); -} - -if (isMainThread) { - // This re-loads the current file inside a Worker instance. - const w = new Worker(import.meta.filename); - - setTimeout(() => { - w.postMessage("Hello! I am from the main thread."); - }, 500); -} else { - console.log("Inside Worker!"); - console.log(isMainThread); // Prints 'false'. - parentPort.on("message", onMessageOneshot); -} |
