testing

Implements unit, integration, E2E, and visual regression tests using Jest and Playwright.

Updated Jan 14, 2026
One-click install
npx skills add https://github.com/jvsandhu/agentic-skills --skill testing-jvsandhu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing
Source: https://github.com/jvsandhu/agentic-skills/tree/main/skills/testing
Command: npx skills add https://github.com/jvsandhu/agentic-skills --skill testing-jvsandhu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Ensuring software quality requires a systematic testing strategy, but teams often struggle to choose the right test level, avoid flaky tests, and structure tests across the pyramid from unit to E2E. ## Core Features & Use Cases - Test Pyramid Strategy: Guides the balance between unit, integration, and E2E tests based on speed, cost, and confidence trade-offs. - Concrete Test Patterns: Provides ready-to-use Jest unit tests with mocking, Supertest API integration tests, Playwright E2E flows, and visual regression snapshots. - TDD Workflow: Enforces the Red-Green-Refactor cycle with phased checklists covering strategy, implementation, and CI/CD verification. - Use Case: When building a checkout feature, use this Skill to write isolated unit tests for price calculation, integration tests for the payment API, and a Playwright E2E scenario simulating the full login-to-checkout flow. ## Quick Start Use the testing skill to create a test plan and write Jest unit tests plus a Playwright E2E test for my login flow.

Frequently Asked Questions about testing

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

FAQPage Schema
How do I write unit tests with Jest?

Jest unit tests use describe and test blocks with expect assertions to verify function behavior in isolation. Use jest.mock to stub external services and mockResolvedValue to control async return values for deterministic results.

How to write E2E tests with Playwright?

Playwright E2E tests simulate real user flows in a browser using page.goto, page.fill, and page.click actions. Assertions like expect(page).toHaveURL and toContainText verify navigation and rendered content after each interaction.

What is the difference between unit, integration, and E2E tests?

Unit tests verify single functions or components quickly and cheaply, integration tests check interactions between modules, databases, or APIs, and E2E tests validate full user flows in a real browser. The test pyramid recommends mostly unit tests, fewer integration tests, and minimal E2E tests.

How do I do visual regression testing with Playwright?

Playwright visual regression testing uses expect(page).toHaveScreenshot to capture and compare page snapshots against baseline images. Any unexpected UI change causes the comparison to fail, catching unintended visual changes automatically.

Why are my tests flaky and how do I fix them?

Flaky tests pass or fail inconsistently, usually due to timing issues, shared state between tests, or non-deterministic mocks. Fix them by isolating tests, using deterministic mock data, and avoiding reliance on real network or timing conditions.