Testing · Senior · Question 71 of 75
Why might a senior engineer argue against a test suite full of toMatchSnapshot() for components?
- ✓Correct answer: Snapshots verify “nothing changed”, not “it's correct”; they get blindly updated and fail on harmless changes
- 2Snapshots can't be run in CI
- 3Snapshots don't work with TypeScript
Explanation
Snapshots fit serialized data (API mappers, error messages), not as a replacement for behaviour tests.