summaryrefslogtreecommitdiff
path: root/test/parallel/test-worker-esm-exit.js
blob: 8c38faf3b72f8d86892d34b50eeb2a518af5d461 (plain)
1
2
3
4
5
6
7
8
9
10
11
'use strict';
const common = require('../common');
const fixtures = require('../common/fixtures');
const assert = require('assert');
const { Worker } = require('worker_threads');

const w = new Worker(fixtures.path('es-modules/import-process-exit.mjs'));
w.on('error', common.mustNotCall());
w.on('exit',
     common.mustCall((code) => assert.strictEqual(code, 42))
);