msw-devtools
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

msw-devtools

NPM

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:

demo

MSW Data inspection:

demo

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

  1. Clone this repo
  2. Create a branch: git checkout -b your-feature
  3. Make some changes
  4. Test your changes
  5. Push your branch and open a Pull Request

LICENSE

MIT

/msw-devtools/

    Package Sidebar

    Install

    npm i msw-devtools

    Weekly Downloads

    127

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    328 kB

    Total Files

    20

    Last publish

    Collaborators

    • alan2207