Skip to content

Commit

Permalink
test: add test on worker process.exit in async modules
Browse files Browse the repository at this point in the history
PR-URL: #43751
Refs: v8/v8@22698d2
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
  • Loading branch information
legendecas authored and danielleadams committed Jul 26, 2022
1 parent 2e1732e commit 6f1d2df
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/parallel/test-worker-process-exit-async-module.js
Original file line number Diff line number Diff line change
@@ -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);
}));

0 comments on commit 6f1d2df

Please sign in to comment.