mirror of
https://github.com/penpot/penpot.git
synced 2026-05-23 07:55:53 -04:00
Add focused common JavaScript test execution with log-level control and a quiet test wrapper matching the frontend workflow. Update developer docs and testing memories to reflect the common/frontend test split, and document why runner helper extraction is deferred. Signed-off-by: Codex <codex@openai.com>
26 lines
694 B
JavaScript
26 lines
694 B
JavaScript
import { spawnSync } from "node:child_process";
|
|
|
|
const progress = (msg) => process.stderr.write(`${msg}\n`);
|
|
|
|
progress("Building test bundle...");
|
|
const build = spawnSync("pnpm", ["run", "build:test"], {
|
|
stdio: ["ignore", "pipe", "pipe"],
|
|
maxBuffer: 64 * 1024 * 1024,
|
|
});
|
|
|
|
if (build.status !== 0) {
|
|
progress("Building test bundle failed");
|
|
if (build.stdout?.length) process.stdout.write(build.stdout);
|
|
if (build.stderr?.length) process.stderr.write(build.stderr);
|
|
process.exit(build.status ?? 1);
|
|
}
|
|
|
|
progress("Running tests...");
|
|
const result = spawnSync(
|
|
"node",
|
|
["target/tests/test.js", ...process.argv.slice(2)],
|
|
{ stdio: "inherit" },
|
|
);
|
|
|
|
process.exit(result.status ?? 1);
|