Files
fusion/packages/dashboard/app/__tests__/build-output-setup.ts
Fusion abe35bea80 test(FN-2343): harden build-output contract coverage
- Add shared test setup helpers that always build dashboard client assets before assertions run
- Remove skip-gated build-output tests and make CLI/dashboard suites deterministic by owning artifact setup
- Enforce hashed vendor chunk naming checks for vendor-react and vendor-xterm in generated assets
- Verify copied CLI client index references real built chunks and does not contain the dashboard stub marker
2026-04-23 13:29:23 -07:00

25 lines
832 B
TypeScript

import { execSync } from "node:child_process";
import { existsSync } from "node:fs";
import { resolve } from "node:path";
const dashboardRoot = resolve(__dirname, "../..");
export const dashboardClientDistDir = resolve(dashboardRoot, "dist/client");
export const dashboardClientAssetsDir = resolve(dashboardClientDistDir, "assets");
/**
* Build output verification must be deterministic: the suite owns artifact setup
* and never skip-gates coverage based on whatever dist/ state already exists.
*/
export function ensureDashboardClientBuild() {
execSync("pnpm build:client", {
cwd: dashboardRoot,
stdio: "pipe",
timeout: 180_000,
});
if (!existsSync(dashboardClientDistDir) || !existsSync(dashboardClientAssetsDir)) {
throw new Error("Dashboard client build did not produce dist/client assets");
}
}