mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-16 04:45:33 -08:00
15 lines
734 B
JavaScript
15 lines
734 B
JavaScript
// Runs the fast test lane: the files listed under `fast` in scripts/test-lanes.json,
|
|||
|
|
// through node-test.mjs so its cap of one file per spare core applies.
|
||
|
|
// Usage: node scripts/test-fast.mjs (or: npm run test:fast)
|
||
|
|
|
||
|
|
import { spawnSync } from "node:child_process";
|
||
|
|
import fs from "node:fs";
|
||
|
|
import path from "node:path";
|
||
|
|
import { fileURLToPath } from "node:url";
|
||
|
|
|
||
|
|
const here = path.dirname(fileURLToPath(import.meta.url));
|
||
|
|
const lanes = JSON.parse(fs.readFileSync(path.join(here, "test-lanes.json"), "utf8"));
|
||
|
|
const files = lanes.fast.map((name) => path.join(here, name));
|
||
|
|
|
||
|
|
const r = spawnSync(process.execPath, [path.join(here, "node-test.mjs"), ...files], { cwd: process.cwd(), stdio: "inherit" });
|
||
|
|
process.exit(r.status ?? 1);
|