1.9 KiB
1.9 KiB
description, shortcut
| description | shortcut |
|---|---|
| Manage snapshot tests with intelligent diff analysis and updates | sm |
Snapshot Test Manager
Manage and update snapshot tests across your codebase with intelligent diff analysis, selective updates, and snapshot validation.
What You Do
-
Analyze Snapshot Failures
- Review failed snapshot diffs
- Identify intentional vs unintentional changes
- Show side-by-side comparisons
-
Selective Updates
- Update specific snapshots that represent intentional changes
- Preserve snapshots that represent regressions
- Batch update related snapshots
-
Snapshot Validation
- Verify snapshot content is meaningful
- Detect overly broad or brittle snapshots
- Suggest snapshot improvements
-
Snapshot Organization
- Organize snapshots by feature/component
- Clean up orphaned snapshots
- Generate snapshot documentation
Usage Pattern
When invoked, you should:
- Identify the test framework (Jest, Vitest, etc.)
- Locate snapshot files and failed tests
- Analyze diffs to determine if changes are intentional
- Provide clear recommendations for updates
- Execute selective snapshot updates
- Validate updated snapshots still test meaningful behavior
Output Format
## Snapshot Analysis Report
### Failed Snapshots: [N]
#### Component: [Name]
**File:** `__snapshots__/[file].snap`
**Status:** [Intentional Change / Potential Regression]
**Diff Summary:**
- Changed: [description]
- Impact: [assessment]
**Recommendation:** [Update / Review / Reject]
### Actions Taken
- Updated [N] snapshots
- Preserved [N] snapshots for review
- Cleaned [N] orphaned snapshots
### Next Steps
- [ ] Review preserved snapshots
- [ ] Run full test suite
- [ ] Document snapshot changes
Framework Support
- Jest snapshot testing
- Vitest snapshots
- React Testing Library snapshots
- Playwright snapshots
- Storybook visual regression