integration-test

Write integration tests for multi-component workflows using Vitest, Testing Library, and MSW.

2|2|Updated May 30, 2025
One-click install
npx skills add https://github.com/wodsmith/thewodapp --skill integration-test-wodsmith
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: integration-test
Source: https://github.com/wodsmith/thewodapp/tree/main/.claude/skills/integration-test
Command: npx skills add https://github.com/wodsmith/thewodapp --skill integration-test-wodsmith

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Integration tests verify that multiple parts of the system work together, providing stronger confidence than unit tests.

Core Features & Use Cases

  • Factory patterns for test data
  • MSW for network mocking
  • Async testing patterns (waitFor, findBy)
  • Custom render with providers for React components

Quick Start

Run the integration test starter: skills_use(name="integration-test")

Frequently Asked Questions about integration-test

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

FAQPage Schema
How do I write integration tests for multi-component workflows with Vitest?

Integration tests with Vitest validate how multiple components and modules work together. Use Testing Library to render components, MSW to mock network requests, factories to generate consistent test data, and a custom render wrapper that includes providers for realistic end-to-end scenarios like auth flows and multi-step forms.

What's the best way to mock API calls in integration tests?

MSW (Mock Service Worker) intercepts network requests at the handler level, letting you define mock responses without changing application code. This approach works across integration tests involving React components, database operations, and full user workflows without modifying your actual API calls.

How do I test async operations like forms and user flows with Vitest?

Use async testing patterns with waitFor and findBy to handle asynchronous component state updates and API responses. Combine these with a custom render wrapper that provides context providers, enabling you to test complete workflows like authentication, form submission, and multi-step processes realistically.

When should I use factory patterns for test data in integration tests?

Factories generate consistent, reusable test data across multiple integration tests, reducing duplication and maintenance burden. They're essential for populating realistic scenarios involving database operations, cross-module interactions, and complex component states across full user flows.

Can I test React components with context providers and custom renders in integration tests?

Yes. A custom render wrapper that includes your application's providers enables integration tests to validate React components within their actual context setup. This supports testing context-dependent workflows, authentication state, and multi-component interactions as they run in production.