Skip to content
affaan-m avatar

React Testing

Behavior-focused React component, hook, and page tests with RTL, MSW mocking, and axe accessibility checks.

CCM score
75 of 100
skills.sh installs
8.5K
GitHub stars
312.6K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers query priority, userEvent interactions, async patterns, custom hook testing, and provider wrapping for components and hooks
  • Includes MSW setup with onUnhandledRequest: "error", per-test handler overrides, and axe assertions via jest-axe or vitest-axe
  • Guides the choice between Vitest, Jest, Playwright Component Testing, and Cypress Component Testing, and the boundary with end-to-end runs
  • Designed for teams writing or fixing React tests who need guidance on when snapshot tests and E2E runs are the wrong tool

Install

$ npx -y skills add affaan-m/ecc --skill react-testing -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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

Details

Repository
github.com/affaan-m/ecc
Categories
Testing & QA, Frontend & UI Code
First seen
Jul 14, 2026

Questions

What does the react-testing skill do for Claude Code?

The react-testing skill guides agents through writing and fixing tests for React components, custom hooks, and pages using React Testing Library and Vitest or Jest. It covers network mocking with MSW, accessibility assertions with axe, and when a test belongs in React Testing Library versus Playwright or Cypress end-to-end runs.

How do I install the react-testing skill?

Run npx -y skills add affaan-m/ecc --skill react-testing -y in your project. Once installed, the agent can write and repair React component, hook, and page tests following the skill's patterns.

Which skills does react-testing sit beside in the Testing & QA category?

React-testing ranks in the top 100 of the Testing & QA category on Claude Marketplaces, alongside tdd, test-driven-development, webapp-testing, and break-ui. It focuses on behavior-focused React component tests rather than general test-driven workflows or browser-level web app testing.

Do I need Playwright or Cypress to use react-testing?

No, the skill is built around React Testing Library with Vitest or Jest running in JSDOM. Playwright or Cypress component testing is only needed when a real browser engine is required, and the skill advises against mixing both runners in one repo without a clear split.

More from affaan-m/ecc

All 257

Similar to React Testing

More Testing & QA