node/test/fixtures/test-runner-watch.mjs
Matteo Collina 2208948e1b
test_runner: fix support watch with run(), add globPatterns option
Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/53866
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2024-07-24 13:11:20 +00:00

25 lines
389 B
JavaScript

import { run } from 'node:test';
import { tap } from 'node:test/reporters';
import { parseArgs } from 'node:util';
const options = {
file: {
type: 'string',
},
};
const {
values,
positionals,
} = parseArgs({ args: process.argv.slice(2), options });
let files;
if (values.file) {
files = [values.file];
}
run({
files,
watch: true
}).compose(tap).pipe(process.stdout);