Covers the full stack of React component testing: React Testing Library queries, userEvent interactions, Vitest/Jest setup, MSW for network mocking, custom hook testing with renderHook, and accessibility assertions via jest-axe. The core philosophy is test user behavior, not implementation details, so you'll query by role and label instead of test IDs, and avoid inspecting internal state. Good coverage of async patterns (findBy, waitFor) and a practical section on when to stay in RTL versus jumping to Playwright component tests. The provider wrapping pattern and MSW setup examples are copy-paste ready. If you're migrating from Enzyme or setting up tests on a greenfield React app, this gives you opinionated defaults that actually work.

skills.sh installs
910
GitHub stars
229.1K
last updated
Jul 14, 2026

Install

$ npx -y skills add affaan-m/everything-claude-code --skill react-testing --agent claude-code

Installs into .claude/skills of the current project.

Files

React Testing

Comprehensive React testing patterns for behavior-focused component tests, custom hook tests, accessibility assertions, and network-level mocking.

When to Activate

  • Writing tests for React components, custom hooks, or pages
  • Adding test coverage to legacy untested components
  • Migrating from Enzyme or class-component-era patterns to React Testing Library
  • Setting up Vitest or Jest for a new React project
  • Mocking HTTP requests in tests
  • Asserting accessibility violations
  • Deciding which tests belong in RTL vs Playwright Component Testing vs full E2E

Core Principle

Test what the user sees and does, not implementation details.

A test should:

  • Render the component with the same providers it has in production
  • Interact with it via accessible queries (role, label) and userEvent
  • Assert visible output and observable side effects (callback fired, request sent)

A test should NOT:

  • Inspect component state, props passed to children, or which hooks were called
  • Mock React itself or framework hooks
  • Assert on the number of renders or DOM structure beyond what affects users

Library Choice

Sponsors

Details

Repository
github.com/affaan-m/everything-claude-code
Categories
Frontend Development, Testing & QA
First seen
Jul 14, 2026

More from affaan-m/everything-claude-code

All 256
1affaan-m avatarreact-performanceaffaan-m/everything-claude-codereact performance903skills.sh installs
2carmahhawwari avatarui-design-braincarmahhawwari/ui-design-brainui design brain877skills.sh installs
3mindrally avatarresponsive-designmindrally/skillsComprehensive guidelines for responsive web design including mobile-first approach, flexible layouts, media queries, and cross-device optimization860skills.sh installs
4saifyxpro avatarui-ux-design-prosaifyxpro/ui-ux-design-pro-skillSenior-level UI/UX design expert for building data-driven, premium production interfaces. Use when you need to: 1. Design complex applications (dashboards, SaaS842skills.sh installs
5onewave-ai avatarcss-animation-creatoronewave-ai/claude-skillsCreate professional CSS animations, transitions, micro-interactions, and complex motion design. Use when adding animations, hover effects, loading states, page 830skills.sh installs
6mindrally avatarvue-typescriptmindrally/skillsExpert in Vue.js TypeScript development with Vite, Pinia, and modern UI frameworks814skills.sh installs