Skip to content
M

MSW

The industry standard for API mocking in JavaScript

by mswjsFree

Domain Rating by Ahrefs75

#419in Developer Tools
0In stores

Description

Mock Service Worker, or MSW, is an API mocking library for JavaScript that works in the browser and in Node.js. You describe the network onc…

Highlights

  • Client-agnostic request handlers reused across tools
  • Works in the browser with a Service Worker and in Node.js
  • Standalone API mocking layer for component testing
  • Built on @mswjs/interceptors
  • Guides and an API reference

Ratings & Reviews

No ratings yet

Be the first to rate MSW.

People also visit

M

Mockoon

Create, run, and share mock REST APIs without coding

Developer Tools
Launch
M

Mockzilla

Open-source OpenAPI mock server with cloud hosting and local modes for…

Developer Tools
Launch
P

Pocket Mocker

In-page HTTP controller for frontend development

Developer Tools
Launch
W

WireMock

A web service test double for all occasions

Developer Tools
Launch
M

MockServer

Easy mocking of any system you integrate with via HTTP or HTTPS

Developer Tools
Launch
M

Mockd

High-performance, multi-protocol mock server

Developer Tools
Launch

MSW FAQ

What is MSW?

A JavaScript API mocking library that intercepts requests in the browser and in Node.js.

How do I define mocks?

Describe the network once with request handlers. The site's example uses http.get on a URL pattern that returns a JSON response.

Do mocks work across frameworks?

The site says they are client-agnostic and can be reused across frameworks, tools and environments.

How is the browser side set up?

With a Service Worker, configured through setupWorker.

What is @mswjs/interceptors?

The request interception library MSW is built on, which the project publishes separately.

Where are the docs?

On the site under Docs, Guides and API, with a Blog for updates.

What are the best MSW alternatives?

Popular alternatives to MSW include Mockoon, Mockzilla and Pocket Mocker. See all MSW alternatives

Developer Stuff

Badges