What problem does it solve?
This Skill eliminates common frontend testing pitfalls for React and Next.js apps, including flaky Vitest specs, inaccessible React Testing Library queries, unregistered Playwright E2E tests that create silent CI coverage gaps, and broken mock factories that cause unexpected test failures.
Core Features & Use Cases
- Vitest best practices: Covers mock factory hoisting, Vitest 4 pool configuration, and fake timer act() patterns to prevent flaky unit and component tests.
- RTL discipline: Enforces accessible query usage, provides workarounds for Radix UI portal limitations in JSDOM, and outlines useLayoutEffect patterns for test-observable state accumulation.
- Playwright E2E guardrails: Includes CI matrix registration requirements, local DB migration steps, whole-document accessibility scans, and guidance to avoid common spec-authoring footguns.
Use case: A frontend team building a Next.js dashboard can use this Skill to ensure all their unit, component, and E2E tests are reliable, accessible, and actually run in CI, catching UI and logic bugs before they reach production.
Quick Start
Use the frontend-testing skill to write or review Vitest specs, React Testing Library component tests, and Playwright E2E tests for your React or Next.js frontend, following all outlined best practices to avoid flaky tests and coverage gaps.