Snapshot Testing
Snapshot testing captures the current output of a component or function — rendered HTML, a data structure, a serialized object — and saves it as a reference; future test runs compare new output against that saved snapshot and fail if anything unexpectedly changed. It's especially common in frontend component testing.
Instead of writing individual assertions for every property of a rendered component, a snapshot test simply asserts "this output matches what we approved last time" — fast to write, and effective at catching unintended changes, but only as good as whether someone actually reviewed the original snapshot carefully before approving it.
The well-known failure mode is snapshot fatigue: when a legitimate change breaks dozens of snapshots at once, it's tempting to blindly approve the update without actually reviewing each diff, which quietly defeats the entire purpose of the test. Snapshot tests work best for stable, low-churn output, not components that change frequently by design.