📝 Add snapshot vs screenshot guidance#6524
Conversation
|
Co-authored-by: dubzzz <[email protected]>
Co-authored-by: dubzzz <[email protected]>
|
👋 A preview of the new documentation is available at: http://697f5570d8053e5bd27da114--dubzzz-fast-check.netlify.app |
@fast-check/ava
fast-check
@fast-check/jest
@fast-check/packaged
@fast-check/poisoning
@fast-check/vitest
@fast-check/worker
commit: |
| **❌ Don't** overuse snapshot tests; only snapshot things when the "what is expected to be seen in the snapshot" is clear | ||
| Why? Snapshots tests tend to capture too many details in the snapshot, making them hard to update given future reader is lost on what was the real thing being tested | ||
|
|
||
| **👍 Prefer** snapshots when DOM structure is important (component hierarchy, attributes); prefer screenshots when final render is important (visual styling, layout) |
There was a problem hiding this comment.
@copilot split into two distinct prefer, one for snap, one for screen, also extend snap tests not only to Dom as you can snap more things so it's mostly a question of shape and structure and non reg too
There was a problem hiding this comment.
Split into two separate guidelines and extended snapshots to cover shape, structure, and non-regression beyond just DOM. Changes in commit 640a74f.
Co-authored-by: dubzzz <[email protected]>
|
👋 A preview of the new documentation is available at: http://697f59c8d5736a6235b62b9c--dubzzz-fast-check.netlify.app |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6524 +/- ##
=======================================
Coverage 94.85% 94.85%
=======================================
Files 207 207
Lines 5581 5581
Branches 1467 1467
=======================================
Hits 5294 5294
Misses 274 274
Partials 13 13
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Adds clarity on when to use snapshot tests versus screenshot tests in the javascript-testing-expert skill.
Changes
The new guidelines:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.