#work #testing
Effective Snapshot Testing – kentcdodds Important points wherer snapshots fail
- Intention
- generated (devs don't pay attention)
- false negatives?
- Fails even if it still "works"
Avoid
- huge snapshots
Utilities
- eslint-plugin-jest called “no-large-snapshots”
- snapshot-diff
Snapshot testing still feels pretty useful to me, but it’s apparent that we can abuse this tool. This tool does not enforce much, which makes it dangerous. The no large snapshots seems to be something we should introduce ASAP. We should also use snapshot diff while we can, and make sure our components are small. This makes me question if we should unit test things like Page.js’s. It feels like they should be integration.