MSW Mock Service Worker
More info
- Creator
- Artem Zakharchenko
- Released
- Type
- API mocking via Service Worker
- License
- MIT
- Website
- mswjs.io
- Source
- github.com/mswjs/msw
Mock HTTP requests at the network layer via Service Worker (browser) or node:http interception (Node) — same code in both environments.
Differs from traditional mocking (axios-mock, fetch-mock) by intercepting at the network layer. The application code doesn't have to change. The default choice in modern React/Vue test stacks paired with React Testing Library + Vitest. Also good with Storybook (render components with mock data).