Skip to content

Commit 6b37fa8

Browse files
committed
test: add test for async disposable worker thread
Signed-off-by: James M Snell <[email protected]>
1 parent e25ce05 commit 6b37fa8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/parallel/test-worker-dispose.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import * as common from '../common/index.mjs';
2+
import { Worker } from 'node:worker_threads';
3+
4+
// Verifies that the worker is async disposable
5+
await using worker = new Worker('for(;;) {}', { eval: true });
6+
worker.on('exit', common.mustCall());
7+
worker[Symbol.dispose]();

0 commit comments

Comments
 (0)