Jest Skill
When to Use
- •Unit, integration, or snapshot testing
- •Testing JS/TS codebases
- •Mocking dependencies
Critical Patterns
- •Use describe/it for structure
- •Use beforeEach/afterEach for setup/teardown
- •Prefer jest.mock for isolation
Decision Tree
- •Unit or integration? → Structure tests accordingly
- •Need mocks? → Use jest.mock
- •Async code? → Use async/await in tests
Edge Cases
- •Mocking ES modules
- •Flaky async tests
- •Snapshot drift