msw
https://github.com/mswjs/msw
TypeScript
Seamless REST/GraphQL API mocking library for browser and Node.js.
Triage Issues!
When you volunteer to triage issues, you'll receive an email each day with a link to an open issue that needs help in this project. You'll also receive instructions on how to triage issues.
Triage Docs!
Receive a documented method or class from your favorite GitHub repos in your inbox every day. If you're really pro, receive undocumented methods or classes and supercharge your commit history.
TypeScript not yet supported0 Subscribers
Add a CodeTriage badge to msw
Help out
- Issues
- 3.0: optional (`?`) and zero-or-more (`*`) params after another param don't match when omitted
- Bypassed multipart POST loses its request line on a kept-alive socket (every second upload gets 400, HPE_INVALID_METHOD), regression in 3.x
- Unhandled InvalidStateError from registration.update() in Firefox on fast navigation
- `@msw/react-native` isn't published, but the v3 release notes and RN guide point to it
- ESM: import { request } from 'node:https' bypasses interception until the patched https.request is called once
- Node.js: streamed response isn't delivered until its first chunk (regression from 2.x)
- Request headers parsed from the socket lose `Cookie` (and other forbidden headers) in browser-like environments
- Two `setupServer()` instances listening at once evaluate every request's handlers twice on Linux — "TypeError: Body is unusable" during handler lookup
- Consider `network.pause()` in `NetworkApi`
- Not intercepting socket.io if it gets imported before MSW
- Docs
- TypeScript not yet supported