MetaMask / MetaMask/contributor-docs
Add guidelines about when and how to use snapshot tests effectively
- Dominant language
- JavaScript
- Stars
- 86
- Forks
- 42
- PR merge metrics
- No merged PRs in 30d
Description
Snapshot tests are often "misused" to create hard-to-understand and brittle tests that are not effective at catching bugs. They can be useful in narrow situations though.
We should write guidance about when and how to effectively use snapshot tests.
There is some mention of snapshot testing here already: https://github.com/MetaMask/contributor-docs/blob/main/docs/testing/unit-testing.md#snapshots
But it doesn't provide enough guidance yet.
References for inspiration:
* https://x.com/searls/status/919594505938112512
* https://www.youtube.com/watch?v=Af4M8GMoxi4
Contributor guide
Research direction
Start with docs/testing/unit-testing.md and its existing Snapshots section. Review the linked references for useful principles, then expand the documentation with guidance on when snapshots are appropriate and how to keep them understandable and effective. Done means the section clearly addresses both appropriate use and common misuse.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation, testing
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100