Skip to content

Commit 9e53faf

Browse files
committed
test: add test for async disposable worker thread
1 parent 170b183 commit 9e53faf

File tree

1 file changed

+10
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)