From web
Guides testing React components, hooks (renderHook), context providers, forms, and advanced patterns with React Testing Library; covers anti-patterns, excludes E2E.
How this skill is triggered — by the user, by Claude, or both
Slash command
/web:skills/react-testingThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill focuses on React-specific testing patterns. For general DOM testing patterns (queries, userEvent, async, accessibility), load the `frontend-testing` skill. For TDD workflow, load the `tdd` skill.
This skill focuses on React-specific testing patterns. For general DOM testing patterns (queries, userEvent, async, accessibility), load the frontend-testing skill. For TDD workflow, load the tdd skill.
React components are functions - Test them like functions: inputs (props) → output (rendered DOM).
Test behavior, not implementation:
Modern RTL handles cleanup automatically:
act() for render, userEvent, or async queriescleanup() - it's automaticbeforeEach| Topic | Guide |
|---|---|
| Testing components, props, and conditional rendering | components.md |
| Testing custom hooks with renderHook | hooks.md |
| Testing context providers and consumers | context.md |
| Testing form inputs, submissions, and validation | forms.md |
| Common React testing mistakes to avoid | anti-patterns.md |
| Loading states, error boundaries, portals, Suspense | advanced.md |
Use components.md when you need:
Use hooks.md when you need:
renderHookresult.current, act(), and rerender()Use context.md when you need:
wrapper option with providersUse forms.md when you need:
Use anti-patterns.md when you need:
act() wrappingcleanup() is unnecessarybeforeEach render patternsUse advanced.md when you need:
React-specific checks:
render() from @testing-library/react (not enzyme's shallow/mount)renderHook() for custom hookswrapper option for context providersact() calls (RTL handles it)cleanup() calls (automatic)beforeEach rendertdd skill)frontend-testing skill)npx claudepluginhub mintuz/skills --plugin webProvides testing patterns and examples for React components, hooks, and integrations using Vitest, React Testing Library, and Jest.
Tests React components with React Testing Library, Vitest/Jest, MSW for network mocking, and axe accessibility assertions. Guides test vs E2E decisions.
Guides React component testing with React Testing Library, Vitest/Jest, MSW mocking, and axe accessibility assertions. Covers test boundaries between component and E2E tests.