node/test/parallel/test-worker-esmodule.js
Anna Henningsen 03fbc9e749 worker: rename to worker_threads
PR-URL: https://github.com/nodejs/node/pull/20876
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
2018-06-13 08:45:04 +02:00

11 lines
393 B
JavaScript

// Flags: --experimental-worker --experimental-modules
'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('worker-script.mjs'));
w.on('message', common.mustCall((message) => {
assert.strictEqual(message, 'Hello, world!');
}));