- 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
25 lines
832 B
TypeScript
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");
|
|
}
|
|
}
|