jest-react-testing

Installation
Summary

Comprehensive React component testing with Jest and React Testing Library covering configuration, mocking, async patterns, and best practices.

  • Covers Jest configuration for JavaScript and TypeScript projects, including setup files, module mapping, and coverage thresholds
  • Provides query strategies prioritizing accessibility (getByRole, getByLabelText) and explains getBy, queryBy, and findBy variants
  • Includes mocking patterns for modules, functions, API calls via MSW, context, and child components with practical examples
  • Demonstrates async testing with waitFor, findBy queries, promises, and fake timers; custom hook testing with renderHook; and integration testing with Router and Redux
  • Offers 15+ Jest DOM matchers, AAA test structure guidance, and troubleshooting for common issues like act warnings and timeout errors
SKILL.md

Jest React Testing

A comprehensive skill for testing React applications using Jest and React Testing Library. This skill covers everything from basic component testing to advanced patterns including mocking, async testing, custom hooks testing, and integration testing strategies.

When to Use This Skill

Use this skill when:

  • Testing React components with Jest and React Testing Library
  • Setting up Jest configuration for React projects
  • Writing unit tests for components, hooks, and utilities
  • Testing user interactions and component behavior
  • Mocking modules, functions, API calls, and external dependencies
  • Testing asynchronous operations (API calls, timers, promises)
  • Testing custom React hooks
  • Writing integration tests for complex component trees
  • Debugging failing tests or improving test coverage
  • Following testing best practices and patterns
Related skills
Installs
669
GitHub Stars
55
First Seen
Jan 21, 2026