summaryrefslogtreecommitdiff
path: root/test/parallel/test-worker-esmodule.js
blob: e7f9bd7aea6c8a22ea900cd9a2fc90bab0317192 (plain)
1
2
3
4
5
6
7
8
9
10
'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!');
}));