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
  • Loading branch information
legendecas committed Jul 10, 2022
1 parent 277b144 commit 6395d1e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 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,10 @@
'use strict';

const common = require('../common');
const assert = require('assert');
const { Worker } = require('worker_threads');

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 6395d1e

Please sign in to comment.