2018-05-17 23:20:25 +00:00
|
|
|
'use strict';
|
|
|
|
if (typeof require === 'undefined') {
|
|
|
|
console.log('1..0 # Skipped: Not being run as CommonJS');
|
|
|
|
process.exit(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
const path = require('path');
|
2022-02-02 23:22:05 +00:00
|
|
|
const { Worker } = require('worker_threads');
|
2018-05-17 23:20:25 +00:00
|
|
|
|
2023-02-23 18:11:51 +00:00
|
|
|
// When --experimental-permission is enabled, the process
|
|
|
|
// aren't able to spawn any worker unless --allow-worker is passed.
|
|
|
|
// Therefore, we skip the permission tests for custom-suites-freestyle
|
|
|
|
if (process.permission && !process.permission.has('worker')) {
|
|
|
|
console.log('1..0 # Skipped: Not being run with worker_threads permission');
|
|
|
|
process.exit(0);
|
|
|
|
}
|
|
|
|
|
2022-02-02 23:22:05 +00:00
|
|
|
new Worker(path.resolve(process.cwd(), process.argv[2]))
|
2018-05-17 23:20:25 +00:00
|
|
|
.on('exit', (code) => process.exitCode = code);
|