msw-devtools
v1.0.2
Published
[![NPM](https://img.shields.io/npm/v/msw-devtools.svg)](https://www.npmjs.com/package/msw-devtools)
Downloads
1,402
Readme
msw-devtools
Devtools for exploring and testing mocked API handlers and data built with msw.
Useful when developing applications using "API first" approach where you mock the API before building the UI.
MSW API handlers testing:
MSW Data inspection:
Installation
NPM
$ npm install msw-devtools
Yarn:
$ yarn add msw-devtools
Usage
import { MSWDevTools } from 'msw-devtools';
import { db, handlers } from '../test/mocks';
export function App({ children }) {
return (
<>
<MSWDevTools db={db} handlers={handlers} />
Hello World
</>
);
}
API
MSWDevTools
import { FactoryAPI } from '@mswjs/data/lib/glossary';
import { RestHandler } from 'msw';
export type MSWDevToolsProps = {
db?: FactoryAPI<any>;
handlers?: RestHandler[];
};
Contributing
- Clone this repo
- Create a branch:
git checkout -b your-feature
- Make some changes
- Test your changes
- Push your branch and open a Pull Request
LICENSE
MIT