Skip to content

Golden Files

Medium — good to knowTesting

ELI5 — The Vibe Check

Golden files are saved 'known good' outputs that you compare against on each test run. If the output changes unexpectedly, the test fails. It's like snapshot testing but for any output — HTML, images, API responses. When the change is intentional, you update the golden file.

Real Talk

A testing technique where expected test output is stored in 'golden' files that serve as the reference for comparison. On each test run, actual output is compared against the golden file. When legitimate changes occur, golden files are explicitly updated. Also known as 'blessed files' or 'reference files.'

When You'll Hear This

"Run with --update-golden flag to regenerate the golden files after the intentional schema change." / "Golden file tests caught the unintentional change in our API response format."

Made with passive-aggressive love by manoga.digital. Powered by Claude.