A snapshot test that failed, an approval taken on the basis that the change was intentional, and a diff nobody opened.
the change: a formatter refactor, expected to alter
whitespace in the generated stylesheet.
the diff, had anybody read it:
- --wp--preset--color--brand: #1f6feb;
+ --wp--preset--color--brand: #1f6feb;
- --wp--preset--spacing--m: 1.5rem;
+ --wp--preset--spacing--m: 1.5;
the unit was dropped for one token. approved, shipped,
and found by a designer three days later.
A snapshot test moves the verification from writing an assertion to reading a diff, and it only works if the diff is read — which is exactly the step that gets skipped when the failure is expected. The mitigation is a smaller snapshot per concern rather than one file, so an unexpected change is not hidden among expected ones.