mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
611a158f1a
PR-URL: https://github.com/nodejs/node/pull/31662 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Yuta Hiroto <hello@hiroppy.me> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Denys Otrishko <shishugi@gmail.com>
16 lines
406 B
JavaScript
16 lines
406 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const fixtures = require('../common/fixtures');
|
|
const assert = require('assert');
|
|
const { Worker } = require('worker_threads');
|
|
|
|
const workerData = 'Hello from main thread';
|
|
|
|
const worker = new Worker(fixtures.path('worker-data.cjs'), {
|
|
workerData
|
|
});
|
|
|
|
worker.on('message', common.mustCall((message) => {
|
|
assert.strictEqual(message, workerData);
|
|
}));
|