summaryrefslogtreecommitdiff
path: root/tools/run-worker.js
blob: 7590e460a404ae98aa248ea45f9a25b59bf58605 (plain)
1
2
3
4
5
6
7
8
9
10
11
'use strict';
if (typeof require === 'undefined') {
  console.log('1..0 # Skipped: Not being run as CommonJS');
  process.exit(0);
}

const path = require('path');
const { Worker } = require('worker_threads');

new Worker(path.resolve(process.cwd(), process.argv[2]))
  .on('exit', (code) => process.exitCode = code);