mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
1c7795e52e
PR-URL: https://github.com/nodejs/node/pull/54705 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
43 lines
608 B
JavaScript
43 lines
608 B
JavaScript
import { run } from 'node:test';
|
|
import { tap } from 'node:test/reporters';
|
|
import { parseArgs } from 'node:util';
|
|
|
|
const options = {
|
|
file: {
|
|
type: 'string',
|
|
},
|
|
cwd: {
|
|
type: 'string',
|
|
},
|
|
isolation: {
|
|
type: 'string',
|
|
},
|
|
};
|
|
const {
|
|
values,
|
|
positionals,
|
|
} = parseArgs({ args: process.argv.slice(2), options });
|
|
|
|
let files;
|
|
let cwd;
|
|
let isolation;
|
|
|
|
if (values.file) {
|
|
files = [values.file];
|
|
}
|
|
|
|
if (values.cwd) {
|
|
cwd = values.cwd;
|
|
}
|
|
|
|
if (values.isolation) {
|
|
isolation = values.isolation;
|
|
}
|
|
|
|
run({
|
|
files,
|
|
watch: true,
|
|
cwd,
|
|
isolation,
|
|
}).compose(tap).pipe(process.stdout);
|