What problem does it solve?
This Skill removes the guesswork from configuring MSW so API mocks behave consistently in development and tests. It helps you avoid silent handler mismatches, flaky test isolation problems, and outdated v1 syntax.
Core Features & Use Cases
- Setup Guidance: Configure the correct browser or Node.js entrypoint, worker or server lifecycle, TypeScript settings, and unhandled-request behavior.
- Handler Design: Organize request handlers by domain, use proper URL matching, parse request bodies explicitly, and return responses with MSW v2 syntax.
- Advanced Mocking: Model authentication, cookies, delays, streaming, GraphQL operations, file uploads, passthroughs, and sequential scenarios.
- Debugging Support: Diagnose interception issues, request mismatches, cache leakage, fake timer conflicts, and concurrent test pollution.
- Use Case: A team migrating from MSW v1 can use this Skill to refactor handlers, harden tests, and standardize mocking behavior across browser development and Node-based test suites.
Quick Start
Ask for an MSW v2 setup or handler refactor that follows these best practices and applies the right rules to your project.