
React Testing
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-codeInstalls 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- React Performance903
- React Patterns893
- Frontend A11y870
- Marketing Campaign827
- Benchmark Optimization Loop826
- Latency Critical Systems818
- Parallel Execution Optimizer813
- Social Publisher806
- Data Throughput Accelerator805
- Prediction Market Risk Review801
- Recursive Decision Ledger801
- Prediction Market Oracle Research796
- Ito Basket Compare794
- Ito Data Atlas Agent794
- Ito Market Intelligence794
- Ito Trade Planner791
- Team Agent Orchestration539
- Dynamic Workflow Mode536
- Security Review11.5K
- Golang Patterns9.9K
- Backend Patterns8.7K
- Coding Standards8.7K
- Frontend Patterns8.6K
- Golang Testing8.4K