testing

Implements unit, integration, and E2E test patterns with Vitest, Playwright, and Testcontainers.

1|Updated Aug 17, 2026
One-click install
npx skills add https://github.com/NalinDalal/skillset --skill testing-nalindalal
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: testing
Source: https://github.com/NalinDalal/skillset/tree/main/skills/devops/testing
Command: npx skills add https://github.com/NalinDalal/skillset --skill testing-nalindalal

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Setting up a coherent test strategy across unit, integration, and E2E layers is time-consuming, and teams often struggle with flaky tests, inconsistent tooling, and unclear coverage targets. ## Core Features & Use Cases - Full Test Pyramid Coverage: Provides ready-to-use configurations and examples for Vitest unit tests, React Testing Library component tests, MSW API mocking, Testcontainers database tests, and Playwright E2E flows. - Coverage Enforcement: Defines concrete coverage thresholds (80% lines/functions, 70% branches) with CI integration via GitHub Actions and Codecov. - Flaky Test Debugging: Includes a diagnostic table mapping common failure symptoms to fixes. - Use Case: When adding a new API endpoint, use this Skill to scaffold an integration test with a real Postgres container, mock external services like Stripe with MSW, and wire coverage reporting into CI. ## Quick Start Ask the agent to set up Vitest with React Testing Library and write tests for a specific component or utility function in your project.

Frequently Asked Questions about testing

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

FAQPage Schema
How do I set up Vitest with React Testing Library?▼

Configure Vitest with the jsdom environment, a setup file registering @testing-library/jest-dom, and cleanup after each test. Add the React plugin and path aliases in vitest.config.ts, then write tests using render, screen, and fireEvent.

How to test API endpoints with a real database?▼

Use Testcontainers to spin up a real Postgres instance in tests, point Prisma at the mapped port, and run migrations before the suite. Clean tables with deleteMany in beforeEach to keep tests isolated.

Vitest vs Playwright: which tool for which test layer?▼

Vitest handles unit, component, and integration tests with fast in-process execution, while Playwright runs E2E tests in real browsers across Chromium, Firefox, and WebKit. Follow the test pyramid: mostly Vitest, a small set of Playwright journeys.

How do I mock external APIs like Stripe or GitHub in tests?▼

Use MSW to intercept HTTP requests at the network layer with a setupServer instance defining route handlers. Start the server in beforeAll, reset handlers after each test, and error on unhandled requests to catch missing mocks.

Why are my Playwright tests flaky in CI?▼

Flakiness usually comes from race conditions, missing async cleanup, or shared state between tests. Enable retries in CI, use waitFor for async assertions, capture traces on first retry, and reset database state between tests.

What coverage thresholds should I enforce in CI?▼

A common baseline is 80% for lines, functions, and statements, and 70% for branches, configured in Vitest's coverage thresholds so CI fails below them. Exclude config files, test helpers, barrel files, and entry points from measurement.