You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gpt-pilot/scripts/run-vitest.mjs

27 lines
553 B
JavaScript

import { spawnPnpmRunner } from "./pnpm-runner.mjs";
const forwardedArgs = process.argv.slice(2);
if (forwardedArgs.length === 0) {
console.error("usage: node scripts/run-vitest.mjs <vitest args...>");
process.exit(1);
}
const child = spawnPnpmRunner({
pnpmArgs: ["exec", "vitest", ...forwardedArgs],
env: process.env,
});
child.on("exit", (code, signal) => {
if (signal) {
process.kill(process.pid, signal);
return;
}
process.exit(code ?? 1);
});
child.on("error", (error) => {
console.error(error);
process.exit(1);
});