testing-strategy-architect

Implements full-stack testing strategies with Vitest, MSW, React Testing Library, and Playwright.

1|Updated Aug 25, 2026
One-click install
npx skills add https://github.com/sabiscore/swarmxq --skill testing-strategy-architect-sabiscore
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-strategy-architect
Source: https://github.com/sabiscore/swarmxq/tree/main/.ai/skills/testing-strategy-architect
Command: npx skills add https://github.com/sabiscore/swarmxq --skill testing-strategy-architect-sabiscore

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires vitest, @vitejs/plugin-react, jsdom, @testing-library/react, @testing-library/user-event, @testing-library/jest-dom, jest-axe, msw, @mswjs/data, @playwright/test.

What problem does it solve? Setting up a coherent testing strategy for a full-stack TypeScript application involves many non-obvious integration points: Vitest configuration, jsdom environments, MSW v2 API mocking, Server Action mocking, Playwright e2e setup, and CI coverage enforcement. This Skill provides a complete, working protocol for every layer of the testing pyramid. ## Core Features & Use Cases - Vitest Unit & Component Tests: Configures Vitest with jsdom, coverage thresholds (80% lines/functions), path aliases, and React Testing Library with accessibility checks via jest-axe. - MSW v2 API Mocking: Sets up Mock Service Worker handlers and a Node test server with per-test handler overrides for empty, error, and success states. - Server Action & Playwright E2E Testing: Mocks Prisma and auth for Next.js Server Actions, and configures Playwright for critical user journeys across desktop and mobile devices. - Use Case: A developer starting a Next.js app with Prisma needs tests before launch. This Skill generates the Vitest config, MSW handlers, component tests, Server Action tests, Playwright auth flows, and the GitHub Actions CI workflow with coverage upload. ## Quick Start Ask the AI to set up a complete testing strategy for your Next.js app with Vitest, MSW, and Playwright including CI integration.

Frequently Asked Questions about testing-strategy-architect

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

FAQPage Schema
How do I set up Vitest for a React TypeScript project?

Install vitest, @vitejs/plugin-react, jsdom, and @testing-library/react, then create a vitest.config.ts with the jsdom environment, globals enabled, and a setupFiles entry. Add coverage thresholds with the v8 provider to enforce minimum line and function coverage.

How to mock API calls in tests with MSW v2?

Define handlers using http.get and HttpResponse from msw, then create a Node server with setupServer from msw/node. Start it in your test setup file with server.listen and use server.use inside individual tests to override responses for error or empty states.

How do I test Next.js Server Actions with Vitest?

Mock the database and auth modules with vi.mock before importing the Server Action, then call the action directly and assert on the mocked calls. This lets you verify authenticated behavior and rejection of unauthenticated requests without a running server.

Does Playwright support mobile device testing?

Yes, Playwright supports mobile emulation through device descriptors like iPhone 14 in the projects configuration. You can run the same e2e tests across desktop Chromium and mobile viewports with a single config file.

What coverage thresholds should I set for a full-stack app?

A common baseline is 80% for lines and functions and 70% for branches, enforced in the Vitest coverage config so CI fails when coverage drops. E2E tests should cover only critical journeys like auth and core workflows rather than chasing percentage targets.

Why do my component tests fail on unhandled API requests?

This happens when MSW is started with onUnhandledRequest set to error and a component calls an endpoint with no matching handler. Add a handler for that endpoint in your handlers file or override it per-test with server.use.