·react-testing-patterns
</>

react-testing-patterns

hieutrtr/ai1-skills

React component and hook testing patterns with Testing Library and Vitest. Use when writing tests for React components, custom hooks, or data fetching logic. Covers component rendering tests, user interaction simulation, async state testing, MSW for API mocking, hook testing with renderHook, accessibility assertions, and snapshot testing guidelines. Does NOT cover E2E tests (use e2e-testing) or TDD workflow enforcement (use tdd-workflow).

20Installs·0Trend·@hieutrtr

Installation

$npx skills add https://github.com/hieutrtr/ai1-skills --skill react-testing-patterns

SKILL.md

Prefer findBy over waitFor + getBy for elements that appear asynchronously.

Create a custom render that wraps components with required providers:

See references/component-test-template.tsx for an annotated test file template. See references/msw-handler-examples.ts for MSW handler patterns. See references/hook-test-template.tsx for hook testing patterns.

React component and hook testing patterns with Testing Library and Vitest. Use when writing tests for React components, custom hooks, or data fetching logic. Covers component rendering tests, user interaction simulation, async state testing, MSW for API mocking, hook testing with renderHook, accessibility assertions, and snapshot testing guidelines. Does NOT cover E2E tests (use e2e-testing) or TDD workflow enforcement (use tdd-workflow). Source: hieutrtr/ai1-skills.

View raw

Facts (cite-ready)

Stable fields and commands for AI/search citations.

Install command
npx skills add https://github.com/hieutrtr/ai1-skills --skill react-testing-patterns
Category
</>Dev Tools
Verified
First Seen
2026-02-06
Updated
2026-02-18

Quick answers

What is react-testing-patterns?

React component and hook testing patterns with Testing Library and Vitest. Use when writing tests for React components, custom hooks, or data fetching logic. Covers component rendering tests, user interaction simulation, async state testing, MSW for API mocking, hook testing with renderHook, accessibility assertions, and snapshot testing guidelines. Does NOT cover E2E tests (use e2e-testing) or TDD workflow enforcement (use tdd-workflow). Source: hieutrtr/ai1-skills.

How do I install react-testing-patterns?

Open your terminal or command line tool (Terminal, iTerm, Windows Terminal, etc.) Copy and run this command: npx skills add https://github.com/hieutrtr/ai1-skills --skill react-testing-patterns Once installed, the skill will be automatically configured in your AI coding environment and ready to use in Claude Code or Cursor

Where is the source repository?

https://github.com/hieutrtr/ai1-skills