0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/parallel/test-worker-esm-exit.js
himself65 060a170e29
test: use common.mustCall in test-worker-esm-exit
PR-URL: https://github.com/nodejs/node/pull/32544
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-04-02 18:26:59 +02:00

12 lines
369 B
JavaScript

'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))
);