Summary This skill teaches best practices for writing JavaScript/TypeScript tests using Jest, covering test structure, mocking strategies, async testing, snapshot testing, React component testing, and common matchers. It provides read-only reference guidance without file writes or shell operations.
Detected Capabilities code analysis best practices documentation test structure guidance mocking strategy explanation matcher reference
Trigger Keywords Phrases that MCP clients use to match this skill to user intent.
write jest tests test react components mock external dependencies jest best practices unit test structure testing async code jest matchers snapshot testing
Use Cases Write unit tests for JavaScript/TypeScript functions and classes Mock external dependencies and APIs in tests Test React components using React Testing Library Create organized test suites with nested describe blocks Test asynchronous code with promises and async/await Write snapshot tests for UI components Apply appropriate Jest matchers for different assertion scenarios Quality Notes Comprehensive coverage of Jest fundamentals with clear, practical examples Well-organized sections (Test Structure, Mocking, Async, Snapshots, React, Matchers) Provides specific patterns and syntax rather than vague guidance Includes recommendations for React Testing Library over Enzyme, demonstrating awareness of modern best practices Jest matcher reference is well-categorized and exhaustive Clear guidance on test file naming conventions and directory organization Explicitly addresses common patterns and anti-patterns (fireEvent vs userEvent) No edge case discussion or error handling guidance — assumes user knows Jest API Lacks examples of complete working test files — only shows fragments No coverage of advanced topics like timer mocks, module mocking edge cases, or performance testing Model: claude-haiku-4-5-20251001 Analyzed: Jun 26, 2026
Reviews Add this skill to your library to leave a review.
No reviews yet
Be the first to share your experience.