Approval Testing
ELI5 — The Vibe Check
Approval Testing captures the output of your code and compares it to a pre-approved 'golden file.' If the output changes, the test fails and shows you the diff. You review it — if it's intentional, approve the new output. If not, you've caught a bug. It's 'diff as testing.'
Real Talk
Approval testing (snapshot testing) captures actual output and compares it against previously approved reference files. On first run, output is saved as the approved version. Subsequent runs diff against it. Changes require explicit approval. Useful for complex outputs (HTML, JSON, images, reports) where manual assertions are impractical.
When You'll Hear This
"Approval testing caught that our PDF generation changed formatting after a library update." / "The golden file shows exactly what the API response should look like — any drift is caught."