feat(gatekeeper): add PR merge automation service
Some checks failed
ci/woodpecker/push/ci Pipeline failed
Some checks failed
ci/woodpecker/push/ci Pipeline failed
This commit is contained in:
36
apps/api/scripts/vitest-runner.mjs
Normal file
36
apps/api/scripts/vitest-runner.mjs
Normal file
@@ -0,0 +1,36 @@
|
||||
import { spawnSync } from "node:child_process";
|
||||
import { join } from "node:path";
|
||||
|
||||
const rawArgs = process.argv.slice(2);
|
||||
const passthroughArgs = [];
|
||||
|
||||
for (let index = 0; index < rawArgs.length; index += 1) {
|
||||
const arg = rawArgs[index];
|
||||
|
||||
if (arg === "--testPathPattern") {
|
||||
const value = rawArgs[index + 1];
|
||||
if (value) {
|
||||
passthroughArgs.push(value);
|
||||
index += 1;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (arg.startsWith("--testPathPattern=")) {
|
||||
passthroughArgs.push(arg.slice("--testPathPattern=".length));
|
||||
continue;
|
||||
}
|
||||
|
||||
passthroughArgs.push(arg);
|
||||
}
|
||||
|
||||
const vitestBin = join(process.cwd(), "node_modules", ".bin", "vitest");
|
||||
const result = spawnSync(vitestBin, ["run", ...passthroughArgs], {
|
||||
stdio: "inherit",
|
||||
});
|
||||
|
||||
if (result.error) {
|
||||
throw result.error;
|
||||
}
|
||||
|
||||
process.exit(result.status ?? 1);
|
||||
Reference in New Issue
Block a user