Skip to content

Commit 525c6b9

Browse files
committed
test: add test on worker process.exit in async modules
1 parent 277b144 commit 525c6b9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
const assert = require('assert');
5+
const { Worker } = require('worker_threads');
6+
7+
// Regression for https://github.com/nodejs/node/issues/43182.
8+
const w = new Worker(new URL('data:text/javascript,process.exit(1);await new Promise(()=>{ process.exit(2); })'));
9+
w.on('exit', common.mustCall((code) => {
10+
assert.strictEqual(code, 1);
11+
}));

0 commit comments

Comments
 (0)