node/test/parallel/test-worker-data-url.js
Rich Trott 6059cbedbd
test: remove unnecessary noop function args to mustCall()
PR-URL: https://github.com/nodejs/node/pull/45027
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-10-18 12:13:41 +00:00

26 lines
880 B
JavaScript

'use strict';
const common = require('../common');
const { Worker } = require('worker_threads');
const assert = require('assert');
new Worker(new URL('data:text/javascript,'))
.on('error', common.mustNotCall(() => {}));
new Worker(new URL('data:text/javascript,export{}'))
.on('error', common.mustNotCall(() => {}));
new Worker(new URL('data:text/plain,'))
.on('error', common.mustCall());
new Worker(new URL('data:text/javascript,module.exports={}'))
.on('error', common.mustCall());
new Worker(new URL('data:text/javascript,await Promise.resolve()'))
.on('error', common.mustNotCall(() => {}));
new Worker(new URL('data:text/javascript,await Promise.reject()'))
.on('error', common.mustCall());
new Worker(new URL('data:text/javascript,await new Promise(()=>{})'))
.on(
'exit',
common.mustCall((exitCode) => { assert.strictEqual(exitCode, 13); })
);