testing

Implements unit, integration, and E2E test strategies using Vitest, Playwright, and MSW.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Teams struggle to decide what to test, which tools to use, and how to structure tests that catch real bugs without becoming flaky or slow. This Skill provides a complete testing strategy covering tool selection, test architecture, mocking patterns, and CI integration for JavaScript/TypeScript projects. ## Core Features & Use Cases - Testing Trophy Decision Framework: Prioritizes integration tests over unit tests, with E2E reserved for critical paths like auth and checkout flows. - Ready-to-Use Patterns: Includes Vitest configuration, Testing Library component tests, Playwright page objects, and MSW network-level mocking with concrete code examples. - CI Integration & Anti-Patterns: Provides a GitHub Actions workflow template and a catalog of common testing mistakes with fixes. - Use Case: When building a Next.js storefront, use this Skill to set up Vitest for cart calculation logic, MSW-mocked integration tests for API routes, and Playwright E2E tests for the checkout flow. ## Quick Start Ask the assistant to set up a testing strategy with Vitest unit tests and Playwright E2E tests for 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 for unit testing in a TypeScript project?▼

Configure vitest.config.ts with globals enabled, jsdom or node environment, a setup file, and v8 coverage provider. Add path aliases via the resolve option, then write tests using describe/it/expect with descriptive names for each behavior.

Playwright vs Cypress for E2E testing, which should I choose?▼

Playwright is recommended for multi-browser support, faster execution, and better developer experience. It includes built-in screenshots, trace capture on retry, and parallel execution across Chromium, Firefox, and mobile device profiles.

How do I mock API requests in component tests with MSW?▼

Define default handlers with http.get and HttpResponse.json, then start a setupServer instance in beforeAll. Override handlers per-test with server.use() for error cases, and reset handlers in afterEach to isolate tests.

What is the testing trophy and how does it differ from the testing pyramid?▼

The testing trophy prioritizes integration tests over unit tests because they catch bugs that matter at module boundaries. E2E tests cover only critical paths like auth and checkout, while unit tests handle pure logic and static analysis runs free.

Why are my Playwright E2E tests flaky in CI?▼

Flakiness usually comes from hard-coded timeouts and race conditions. Use expect-based waiting and accessible selectors like getByRole instead of fixed delays, enable retries only in CI, and capture traces on first retry for debugging.

What should I not write tests for?▼

Avoid testing third-party library internals, implementation details like state shape, CSS styling, and framework lifecycle methods. Focus tests on business logic, user interactions, error states, API contracts, and accessibility roles.