• Stars
    star
    565
  • Rank 78,889 (Top 2 %)
  • Language
    JavaScript
  • Created over 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Examples of Mock Service Worker usage with various frameworks and libraries.

Usage examples

Collection of usage examples of Mock Service Worker library.

Example structure

Usage examples have a consistent README structure, so it's easier to comprehend and cross-reference them.

Each example always has the following sections:

  1. "Getting started", a list of instructions to get this specific example running on your local machine.
  2. "Key points", highlights of the implementation necessary to achieve the example. Include exact file references and a brief explanation.

Full examples

Complete examples showcase Mock Service Worker integration on all levels: for development, unit, and E2E tests.

React

Angular

Scoped examples

Scoped examples illustrate the usage of Mock Service Worker with particular libraries or frameworks.

More Repositories

1

msw

Industry standard API mocking for JavaScript.
TypeScript
15,862
star
2

data

Data modeling and relation library for testing JavaScript applications.
TypeScript
627
star
3

interceptors

Low-level HTTP/HTTPS/XHR/fetch request interception library.
TypeScript
420
star
4

msw-storybook-addon

Mock API requests in Storybook with Mock Service Worker.
TypeScript
392
star
5

mswjs.io

Official website and documentation for the Mock Service Worker library.
TypeScript
154
star
6

source

Generate MSW request handlers from various sources (HAR files, OpenAPI documents, etc).
TypeScript
120
star
7

http-middleware

Spawn an HTTP server from your request handlers or apply them to an existing server using a middleware.
TypeScript
73
star
8

jest-fixed-jsdom

A superset of the JSDOM environment for Jest that respects Node.js globals.
JavaScript
30
star
9

node-match-path

Matches a URL against a path. Parameters, wildcards, RegExp.
TypeScript
30
star
10

headers-polyfill

A Fetch API "Headers" polyfill and transformation library.
TypeScript
27
star
11

cookies

Manage request/response cookies in the environments where those are not supported.
TypeScript
19
star
12

storage

Persistence and live synchronization layer for testing JavaScript applications.
TypeScript
16
star
13

is-node-process

Reliably determines if the code is running in Node.js. Treats Jest, React Native, Electron, and others like Node.js.
TypeScript
9
star
14

examples-new

6
star
15

gh-issue-forms

A test repository that is going to disappear.
Shell
4
star
16

msw-github-bot

Mock Service Worker community bot. Beep. Bop.
TypeScript
3
star
17

github-webhooks

TypeScript
1
star
18

local-storage-polyfill

The "localStorage" polyfill for Node.js.
TypeScript
1
star