Snapshot Testing
Capturing a serialized representation of a value or rendered output and comparing future test runs against that saved baseline, flagging any unexpected differences.
Snapshot testing is a testing technique where, instead of writing out explicit assertions describing every expected property of a complex output, you capture a serialized snapshot of the output the first time a test runs, save it as a baseline file, and on every subsequent test run, automatically compare the current output against that saved snapshot — flagging a failure if anything differs, prompting you to review whether the difference is an intentional change (in which case you update the snapshot) or an actual regression (in which case you fix the code).
Snapshot testing is like a security system that photographs a room's exact layout once and, on every subsequent check, compares a fresh photo against that saved baseline, immediately flagging anything that's moved — but the system is only useful if a human genuinely looks at the flagged differences and decides whether they're expected (someone rearranged furniture on purpose) versus a real problem, rather than reflexively approving every alert without looking.