0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-21 21:19:50 +01:00
nodejs/test/parallel/test-worker-data-url.js
Antoine du Hamel d9f394e607
test: remove unnecessary noop function args to mustNotCall()
PR-URL: https://github.com/nodejs/node/pull/48513
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Harshitha K P <harshitha014@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2023-06-24 16:16:07 +02:00

26 lines
856 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); })
);