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: nodejs/node#43751
Backport-PR-URL: nodejs/node#44085
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 guangwong committed Oct 10, 2022
1 parent 0e86d89 commit a727b31
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 a727b31

Please sign in to comment.