What problem does it solve?
This Skill prevents broken or flaky API mocking setups by teaching the correct MSW v2 patterns for handler matching, request/response handling, and test isolation so your tests fail loudly instead of silently.
Core Features & Use Cases
- Reliable MSW v2 handler design: structure handlers, parse request bodies explicitly, and use the correct HttpResponse syntax so mocks behave consistently across environments.
- Deterministic test behavior: configure server lifecycle hooks, reset handlers between tests, and isolate concurrent tests with server.boundary() to eliminate handler leakage and race conditions.
- Accurate API simulation: mock real-world REST/GraphQL behavior including query matching, GraphQL operation-based handlers, streaming responses, and correct error semantics.
Quick Start
Tell an AI to generate an MSW v2 server setup and a set of REST and GraphQL request handlers that correctly parse request bodies, match URLs, and enforce strict unhandled-request failures for your test suite.