⚠️ WARNING: Pre-release Version
In this pre-release version, every update clears the configuration storage!
Be cautious and make sure to save your JSON configurations locally to avoid losing them. 💾
This Chrome extension simplifies working with Mock Service Worker (MSW). Instead of manually writing handlers, you can upload JSON files with mock requests, manage multiple configurations, and switch between them seamlessly. 🛠️
Easily upload JSON files containing mock request configurations.
Switch seamlessly between multiple JSON configurations within the same host environment.
Enable pass-through mode to bypass JSON config and send requests directly to the server even if configurations are uploaded.
This extension is a game-changer for both developers and QA testers working with MSW. 🧑💻👩💻
Instead of manually defining handlers for every request, you can now upload pre-configured JSON files, whether it's a single file or multiple files for different scenarios. Switching between configurations is quick and easy, making this tool highly efficient for various development and testing workflows. 🚀
npm install @msw-devtools/connect --save-exact
Use --save-exact
when you install chrome extension from the repository
We assume that you are already familiar with Mock Service Worker (MSW) and have set up your project to work with it. If not, please visit the official MSW website for guidance.
Just add the response resolver handler from @msw-devtools/connect
import { http } from 'msw'
import { setupWorker } from 'msw/browser'
import { createResponseResolver } from '@msw-devtools/connect'
const handlers = [http.all('*', createResponseResolver())]
setupWorker(...handlers).start({
onUnhandledRequest: 'bypass'
})
You can install it downloading the build and loading it as an unpacked extension.
⚠️ WARNING If you chose to install the extension from the repository, you will need install@msw-devtools/connect
with--save-exact
flag to avoid version mismatch.
⚠️ WARNING Chrome Web Store version can be outdated because of the review process.If you want to install from the Chrome Web Store, you need to check the latest version in the repository and compare it with the Chrome Web Store version.
We recommend using the latest build from the repository.
At this page we have installed msw and initialized with the createResponseResolver
function from @msw-devtools/connect
.
- Edit json config in the DevTools: Currently, you can only upload JSON files, but you can't edit them in the DevTools.
- Upload multiple JSON configs: Currently, you can only upload one JSON file at a time, because it simplifies the process of validation.
- Multi window support: Currently, you can use multi tabs with different configurations per host, but only one browser window is supported.
- Early request interception: Currently, requests sent before the extension is initialized are not intercepted by JSON handlers.