Skip to content

Commit 73e0b71

Browse files
committed
use isMainThread
1 parent adcf374 commit 73e0b71

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

test/fixtures/es-modules/tla/unresolved-with-worker-process-exit.mjs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import { Worker } from 'worker_threads';
1+
import { Worker, isMainThread } from 'worker_threads';
22

3-
// Do not use isMainThread so that this test itself can be run inside a Worker.
4-
if (!process.env.HAS_STARTED_WORKER) {
5-
process.env.HAS_STARTED_WORKER = 1;
3+
if (isMainThread) {
64
new Worker(new URL(import.meta.url));
75
await new Promise(() => {});
86
} else {

0 commit comments

Comments
 (0)