mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
PR-URL: https://github.com/nodejs/node/pull/57438 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
36 lines
588 B
JavaScript
36 lines
588 B
JavaScript
import { run } from 'node:test';
|
|
import { spec } from 'node:test/reporters';
|
|
import { parseArgs } from 'node:util';
|
|
|
|
const options = {
|
|
file: {
|
|
type: 'string',
|
|
},
|
|
globalSetup: {
|
|
type: 'string',
|
|
},
|
|
isolation: {
|
|
type: 'string',
|
|
},
|
|
};
|
|
|
|
const {
|
|
values,
|
|
} = parseArgs({ args: process.argv.slice(2), options });
|
|
|
|
let files;
|
|
let globalSetupPath;
|
|
|
|
if (values.file) {
|
|
files = [values.file];
|
|
}
|
|
|
|
if (values.globalSetup) {
|
|
globalSetupPath = values.globalSetup;
|
|
}
|
|
|
|
run({
|
|
files,
|
|
globalSetupPath,
|
|
}).compose(spec).pipe(process.stdout);
|