mirror of
https://github.com/nodejs/node.git
synced 2025-05-07 15:35:41 +00:00

Fixes: https://github.com/nodejs/node/issues/25765 PR-URL: https://github.com/nodejs/node/pull/25768 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
17 lines
446 B
JavaScript
17 lines
446 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.mjs'), {
|
|
workerData,
|
|
execArgv: ['--experimental-modules']
|
|
});
|
|
|
|
worker.on('message', common.mustCall((message) => {
|
|
assert.strictEqual(message, workerData);
|
|
}));
|