node/test/fixtures/worker-preload.js

10 lines
136 B
JavaScript

const {
Worker,
workerData,
threadId
} = require('worker_threads');
if (threadId < 2) {
new Worker('1 + 1', { eval: true });
}