Skip to content

Commit 66fccc2

Browse files
jasnelladuh95
authored andcommitted
test: add test for async disposable worker thread
PR-URL: nodejs#58385 Backport-PR-URL: nodejs#58455 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 8dbc6b2 commit 66fccc2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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+
const worker = new Worker('for(;;) {}', { eval: true });
7+
worker.on('exit', common.mustCall());
8+
await worker[Symbol.asyncDispose]();
9+
}

0 commit comments

Comments
 (0)