31 lines
858 B
TypeScript
31 lines
858 B
TypeScript
import { spawnSync } from "node:child_process";
|
|
|
|
const result = spawnSync(
|
|
process.execPath,
|
|
["scripts/check-design-system.ts", "--fixture"],
|
|
{
|
|
cwd: process.cwd(),
|
|
encoding: "utf8",
|
|
},
|
|
);
|
|
|
|
const output = `${result.stdout ?? ""}
|
|
${result.stderr ?? ""}`;
|
|
if (result.status === 0) {
|
|
process.stderr.write(
|
|
"Design-system negative fixture unexpectedly passed; raw product palette regression is not protected.\n",
|
|
);
|
|
process.exit(1);
|
|
}
|
|
if (!output.includes("raw product palette value in tests/fixtures/design-system/forbidden/memento-raw-product.css")) {
|
|
process.stderr.write(
|
|
"Design-system negative fixture failed, but not because the Memento raw palette was rejected.\n",
|
|
);
|
|
process.stderr.write(output);
|
|
process.exit(1);
|
|
}
|
|
|
|
process.stdout.write(
|
|
"Design-system fixtures: Memento raw product palette rejected PASS\n",
|
|
);
|