/fuse-react:react-testingfrom fuse-react
Tests React 19 components with Testing Library and Vitest using user-centric queries, realistic interactions, MSW for API mocking, and covers React 19 features, hooks, Suspense, error boundaries, and accessibility audits.
Ships in fuse-react. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Also covers testing React 19 features (useActionState, use()), custom hooks, Suspense boundaries, error boundaries, and accessibility audits with axe-core. Provides Vitest configuration and 9 ready-to-copy test templates. This is a testing-methodology skill layered on top of the React skills (react-19, react-state, react-forms) — it doesn't teach those APIs themselves, only how to test components that use them.
Test React components the way users interact with them.
Before ANY implementation, spawn 3 agents in parallel, one Agent call each with a name:
After implementation, run fuse-ai-pilot:sniper for validation.
| Feature | Benefit |
|---|---|
| User-centric | Tests what users see |
| Accessible queries | Encourages a11y markup |
| No implementation details | Resilient to refactoring |
| Vitest integration | 10-20x faster than Jest |
getByRole is most accessiblesetTimeout| Topic | Reference |
|---|---|
| Setup & installation | references/installation.md |
| Query priority | references/queries.md |
| User interactions | references/user-events.md |
| Async patterns | references/async-testing.md |
| API mocking | references/msw-setup.md |
| React 19 hooks | references/react-19-hooks.md |
| Accessibility | references/accessibility-testing.md |
| Custom hooks | references/hooks-testing.md |
| Vitest config | references/vitest-config.md |
| Mocking patterns | references/mocking-patterns.md |
| Template | Use Case |
|---|---|
templates/basic-setup.md | Vitest + RTL + MSW config |
templates/component-basic.md | Simple component tests |
templates/component-async.md | Loading/error/success |
templates/form-testing.md | Forms + useActionState |
templates/hook-basic.md | Custom hook tests |
templates/api-integration.md | MSW integration tests |
templates/suspense-testing.md | Suspense + use() |
templates/error-boundary.md | Error boundary tests |
templates/accessibility-audit.md | axe-core a11y audit |
| Pattern | Reason | Alternative |
|---|---|---|
fireEvent | Not realistic | userEvent |
setTimeout | Flaky | waitFor, findBy |
getByTestId first | Not accessible | getByRole |
| Direct fetch mocking | Hard to maintain | MSW |
Empty waitFor | No assertion | Add expect() |
npm install -D vitest @testing-library/react \
@testing-library/user-event @testing-library/jest-dom \
jsdom msw
→ See templates/basic-setup.md for complete configuration
import { render, screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
test('button click works', async () => {
const user = userEvent.setup()
render(<Button onClick={fn}>Click</Button>)
await user.click(screen.getByRole('button'))
expect(fn).toHaveBeenCalled()
})
→ See templates/component-basic.md for more examples
getByRole - Buttons, headings, inputsgetByLabelText - Form inputsgetByText - Static textgetByTestId - Last resort// Preferred: findBy
await screen.findByText('Loaded')
// Alternative: waitFor
await waitFor(() => expect(...).toBeInTheDocument())
→ See templates/component-async.md
const user = userEvent.setup()
await user.click(button)
await user.type(input, 'text')
→ See references/user-events.md
references/accessibility-testing.md (opens in a new tab)references/async-testing.md (opens in a new tab)references/hooks-testing.md (opens in a new tab)references/installation.md (opens in a new tab)references/mocking-patterns.md (opens in a new tab)references/msw-setup.md (opens in a new tab)references/queries.md (opens in a new tab)references/react-19-hooks.md (opens in a new tab)references/templates/accessibility-audit.md (opens in a new tab)references/templates/api-integration.md (opens in a new tab)references/templates/basic-setup.md (opens in a new tab)references/templates/component-async.md (opens in a new tab)references/templates/component-basic.md (opens in a new tab)references/templates/error-boundary.md (opens in a new tab)references/templates/form-testing.md (opens in a new tab)references/templates/hook-basic.md (opens in a new tab)references/templates/suspense-testing.md (opens in a new tab)references/user-events.md (opens in a new tab)references/vitest-config.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
8 skills in this plugin
/react-19Use when implementing React 19.3 patterns — use(), useOptimistic, useActionState, useEffectEvent, Activity, ViewTransition, Fragment refs, use(browser()), React Compiler./react-formsUse when building type-safe forms in React with TanStack Form v1 — Zod/Yup/Valibot validation, async validation, field arrays./react-i18nUse when implementing translations in a React app (not Next.js) with react-i18next — useTranslation, namespaces, pluralization, Suspense.npx claudepluginhub fusengine/claude-plugins --plugin fuse-reactOther plugins' skills for the same job