mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-10-03 18:23:47 +10:00
Adding packages/pdf to CI turned it red on ubuntu-latest for two reasons, neither of which is a real regression. Rasterized pixels depend on the host font rasterizer. The chikorita, ditto and all-template baselines differ on Linux in rasterSha256 alone: every page count, item count and text coordinate is byte-identical to the macOS-authored baseline. Compare the portable geometry on every host and the pixels only on the platform the PNGs were generated on, so the characterization keeps protecting layout without asserting another machine's antialiasing. The picture-fit override case rasterizes twice and timed out at Vitest's 5s default on a CI runner, with the date suite landing at 3.5-4.7s. Give the package a 30s timeout rather than leaving every rendering test a runner slowdown away from failing. Verified on linux/amd64 in Docker: both files pass, 18/18.
18 lines
702 B
TypeScript
18 lines
702 B
TypeScript
import { fileURLToPath } from "node:url";
|
|
// @boundaries-ignore root shared Vitest config
|
|
import { createVitestProjectConfig } from "../../vitest.shared.mts";
|
|
|
|
const config = createVitestProjectConfig({
|
|
name: "@reactive-resume/pdf",
|
|
dirname: fileURLToPath(new URL(".", import.meta.url)),
|
|
});
|
|
|
|
export default {
|
|
...config,
|
|
// Rendering and rasterizing real PDFs is far slower than Vitest's 5s default: the all-template
|
|
// date characterization renders 15 templates in one test, and the picture-fit override case
|
|
// rasterizes twice. Both land within a second or two of the default on a CI runner.
|
|
test: { ...config.test, testTimeout: 30_000 },
|
|
oxc: { jsx: { runtime: "automatic" as const } },
|
|
};
|