28
snapshot test
Pin output to a file. If it changes, red. Good for characterization. Bad at asserting intent.
What is snapshot test?
A snapshot test archives serialised output and diffs it next run. It is good at “did something unexpected move,” bad at “is this right.”
Why does snapshot test matter when vibe coding?
Models fidget with copy and DOM structure. Snapshots yell. If the model may update snapshots itself, it is grading its own exam. Humans own the update.
How do you do snapshot test?
Snapshots on critical render paths. The prompt says: no -u. If a snapshot must move, you run it, you read the diff.
How do you ask a model for snapshot test?
Add snapshots that lock output for (paths). Do not update snapshots this turn. If they go red, stop and show me the diff.
What goes wrong with snapshot test?
A megalith snapshot that goes red on CSS whitespace. Keep them small and aimed at behaviour.