react-testing

Set up and write Playwright and Vitest tests for React applications.

Updated Jun 23, 2026
One-click install
npx skills add https://github.com/jaballer/react-claude-skills --skill react-testing-jaballer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-testing
Source: https://github.com/jaballer/react-claude-skills/tree/main/react-testing
Command: npx skills add https://github.com/jaballer/react-claude-skills --skill react-testing-jaballer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @playwright/test, vitest, jsdom, @testing-library/react, @testing-library/jest-dom, @axe-core/playwright, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide to testing React applications, offering strategies and setup instructions for both Playwright (E2E) and Vitest (unit/component) testing tools.

Core Features & Use Cases

  • Testing Strategy: Offers a senior testing pyramid approach for React SPAs, focusing on unit and E2E testing.
  • Playwright Setup: Provides detailed setup instructions for Playwright, including configuration and project structure.
  • Vitest Setup: Includes setup instructions for Vitest with jsdom and Testing Library, tailored for React applications.
  • Accessibility Testing: Covers a11y-first locators and assertion patterns for accessibility testing with Playwright and axe-core.
  • Use Case: Ideal for developers looking to implement a robust testing strategy for their React applications, ensuring both functionality and accessibility.

Quick Start

Use the react-testing skill to set up your testing environment for a React application.

Frequently Asked Questions about react-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up Vitest and Playwright for React testing?

Implement a React testing strategy by configuring Vitest with jsdom and Testing Library for unit and component tests, while using Playwright for E2E tests. This skill provides the setup instructions and configuration files needed to initialize both frameworks.

What is the best way to structure a React testing pyramid?

A robust React testing pyramid prioritizes unit and component tests using Vitest, supplemented by E2E tests using Playwright. This skill outlines a senior testing approach to balance coverage and execution speed for React SPAs.

How do I test accessibility in a React application with Playwright?

Test accessibility in React by integrating axe-core with Playwright to run automated a11y checks. This skill provides specific patterns for using a11y-first locators and assertions to identify and resolve accessibility violations during E2E tests.

Does this React testing setup require jsdom and Testing Library?

Yes, this React testing setup requires jsdom and @testing-library/react to simulate a DOM environment for Vitest. These dependencies enable component rendering and DOM interaction assertions during unit and component tests.

Can I use Vitest for component testing instead of Playwright?

Yes, use Vitest with Testing Library and jsdom for React component testing to isolate UI logic and rendering. This approach reserves Playwright for full E2E testing flows, ensuring a balanced and efficient testing strategy.