A collection of usage examples of Mock Service Worker.
- Angular (Jest, Cypress)
- Next.js
- React Native
- Remix (Playwright)
- SolidJS
- Svelte (Vitest, Playwright)
- Vue (Vitest, Cypress)
- Cypress
- Jest
- Karma
- Playwright
- Vitest / Vitest (CommonJS)
- Storybook
Each example is a standalone repository featuring the usage of MSW with a certain framework or tool. Follow the instructions written in the README.md
of respective examples to integrate MSW with those particular technologies. Some examples have separate instructions for client-side and server-side integrations. You can choose either or both, depending on where you wish to gain control over the network with MSW. We highly recommend implementing both client-side and server-side interception to guarantee seamless development and testing experience.
Each example can be forked immediately with CodeSandbox. To do so, click on the "Edit on CodeSandbox" button in the README.md
of the respective example. This will load it in the cloud, allowing you to experiment with the integration and create reproduction cases easier.