Why are snapshots often considered an anti-pattern?
Snapshots are often considered an anti-pattern because they compare too much and check too little meaning. As a result, the test formally exists, but provides almost no real benefit.
The main reasons snapshots are criticized
1) Tests stop checking behavior A snapshot captures a huge chunk of markup or data. It does not answer the question "does the component work correctly?", it only answers "has nothing changed line by line?"
2) "Update the snapshot" becomes a reflex In most cases, developers simply click update snapshot without even reading the changes. Tests turn into noise instead of protection.
3) Hard to notice the real problem The markup can be large. In a diff it is easy to miss a real bug among dozens of insignificant changes (for example, an extra div gets lost among hundreds of lines).
4) Fragility and false positives Any small thing breaks the snapshot: a line wrap, an attribute, a class, formatting. The component can be completely functional, yet the test fails.
5) No explicit test intent A good test answers a clear question: "If the user clicks the button, what happens?" A snapshot test answers: "The output should be the same as it once was" This is too vague.
Summary
Snapshots are often called an anti-pattern because they:
- poorly reflect the component's true logic,
- quickly turn into routine,
- give a false sense of security instead of real quality control.
That is why experienced teams prefer meaningful, targeted behavior checks instead of "huge snapshots of everything under the sun."
Short Answer
Interview readyA concise answer to help you respond confidently on this topic during an interview.