React testing

From JosiahSiegel/claude-plugin-marketplace · View interactive version

React testing is an AI agent skill from the GitHub repository JosiahSiegel/claude-plugin-marketplace. | Complete React testing system. PROACTIVELY activate for: (1) Vitest/Jest setup and configuration, (2) React Testing Library patterns, (3) Component testing with userEvent, (4) Custom hook testing with renderHook, (5) Mocking modules and components, (6) Async component testing, (7) Context and prov

How to use this skill

Skill file

React Testing Skill

Use this skill for React tests that focus on user behavior: Vitest/Jest setup, Testing Library queries, user-event flows, async UI, hooks, providers, mocks, integration tests, accessibility checks, and media component tests.

When to Use This Skill

Use when the user asks for tasks covered by the frontmatter triggers, especially implementation guidance, debugging, architecture choices, production hardening, or performance-sensitive decisions in this domain. Start from this orchestrator, then load the focused reference file that matches the requested detail level.

Core Workflow

  1. Set up the runner and jsdom environment first, then centralize @testing-library/jest-dom, cleanup, and browser API mocks in test setup.
  2. Write tests from the user perspective using role, label, text, placeholder, and display-value queries before falling back to test IDs.
  3. Use userEvent.setup() for interactions and waitFor or findBy queries for async state changes.
  4. Mock at module or network boundaries, not internal component state, and reset mocks between tests.
  5. Create provider-aware render utilities for context, routers, query clients, themes, and other app-wide wrappers.
  6. For media components, mock jsdom gaps such as HTMLMediaElement.play, pause, load, metadata properties, and IntersectionObserver.

Key Gotchas

Reference Map

Response Guidance

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.