testing-rules

Community

Elevate tests with Vitest, RTL, and Playwright

Authormauriciodelrio
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Testing React applications can be fragmented, with inconsistent configurations and a lack of guidance on unit, integration, and end‑to‑end testing. Developers often struggle to set up Vitest, React Testing Library, Playwright, mocking, and coverage targets efficiently.

Core Features & Use Cases

  • Unified testing setup: Provides Vitest configuration with jsdom, coverage thresholds, and shared setup files for both Next.js and Vite SPA projects.
  • Accessibility‑first queries: Prioritizes RTL queries such as role, label, placeholder, and text to ensure tests are aligned with WCAG standards.
  • Realistic user interactions: Enforces userEvent.setup() over fireEvent for authentic event simulation.
  • Hook testing support: Demonstrates renderHook usage with custom provider wrappers.
  • Robust mocking: Shows vi.mock for module mocking and MSW for realistic network request handling.
  • E2E automation: Supplies Playwright configuration and example tests for critical business flows.
  • Consistent test patterns: Promotes the AAA structure, test data builders, and custom render utilities with providers.

Quick Start

Ask the assistant to configure Vitest, RTL, and Playwright for a new React project and generate a sample test file following the outlined patterns.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: testing-rules
Download link: https://github.com/mauriciodelrio/delriodev-skills/archive/main.zip#testing-rules

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.