mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
test: add test on worker process.exit in async modules
PR-URL: https://github.com/nodejs/node/pull/43751 Refs: https://github.com/v8/v8/commit/22698d267667ad36f8b1d2c1f5ec71f54fcea3eb Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
This commit is contained in:
1 file changed
+11
@@ -0,0 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
const common = require('../common');
|
||||
const assert = require('assert');
|
||||
const { Worker } = require('worker_threads');
|
||||
|
||||
// Regression for https://github.com/nodejs/node/issues/43182.
|
||||
const w = new Worker(new URL('data:text/javascript,process.exit(1);await new Promise(()=>{ process.exit(2); })'));
|
||||
w.on('exit', common.mustCall((code) => {
|
||||
assert.strictEqual(code, 1);
|
||||
}));
|
||||
Reference in new issue
Block a user