Mock Service Worker
API mocking at the network level for browser and Node.js
Visit mswjs.io FreeOpen source
Mock Service Worker (MSW) intercepts outgoing requests at the network level and returns mocked responses, using a Service Worker in the browser and request interception in Node.js. The same REST, GraphQL, and WebSocket handlers can be reused across unit tests, end-to-end tests, Storybook, and local development.
Key features
- Network-level request interception
- REST, GraphQL, and WebSocket handlers
- Same mocks in browser and Node.js
- Framework- and client-agnostic
Try it on DevTools Daily
Similar tools
Vitest
Next-generation testing framework powered by Vite

Jest
Delightful JavaScript testing framework with a focus on simplicity

Testing Library
Test UI components the way users interact with them

Cypress
JavaScript end-to-end and component testing that runs in the browser
Faker
Generate massive amounts of realistic fake data for testing and development

Grafana k6
Developer-centric load testing with tests written in JavaScript