Files
gstack/make-pdf/test/e2e/browser-available.ts
T
SinaandClaude Fable 5.1 f74d3a1a63 refactor(make-pdf): print through Aside first, the bundled browser otherwise
asideClient.ts replaces the direct $B client with one render() call per PDF (the exact option mapping the browse pdf command had: paper, margins, header/footer/page numbers, tagged, outline, printBackground, preferCSSPageSize, Paged.js wait); the diagram pre-pass, oversized-image downscale and DOCX rasters each run as one render script with per-fence try/catch; exit 4 now means no browser is available and names both remedies; $P setup reports which engine it found. The e2e gates run on whichever engine is present, so the Linux lane exercises the fallback.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-05 16:48:37 -04:00

16 lines
710 B
TypeScript

/**
* Gate prerequisite shared by the make-pdf e2e gates: SOME browser the
* compiled binary can print through — the Aside app (macOS dev machines) or
* gstack's own browse binary (what the Linux free-tests lane builds via
* build:gates). Mirrors lib/aside-render's pickEngine() order.
*/
import { resolveBrowseBin } from "../../../lib/aside-render";
import { asideAvailable } from "../../../test/helpers/aside-available";
export const NO_BROWSER_REASON =
"no browser available (open the Aside app, or build gstack's own browser with `bun run build:gates`; GSTACK_SKIP_ASIDE=1 skips Aside).";
export function browserAvailable(): boolean {
return asideAvailable() || resolveBrowseBin() !== null;
}