Skip to content

Commit 7a91f4a

Browse files
jasnelltargos
authored andcommitted
test: add test for async disposable worker thread
PR-URL: #58385 Reviewed-By: LiviaMedeiros <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Daeyeon Jeong <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]>
1 parent aeb9ab4 commit 7a91f4a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/parallel/test-worker-dispose.mjs

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

0 commit comments

Comments
 (0)