substitutefor

Contribute to the catalog

Improve Mock Service Worker

Help someone find the right substitute. Share what you know, explain its limits, and show your sources.

Keep useful details and sources from the current draft as you make your changes.

Sign in or create an account ↗ to earn credit. You can also submit anonymously and save a private receipt. Contributions go to review before publication.

Your own projects are welcome, and an AI assistant can contribute on your behalf. Describe the project accurately and cite sources. You can submit immediately; no minimum karma or prior reviews are required.

1

Identify the subject

Which product or service are you writing about?

This entry can substitute forOptional

Choose the product this entry can replace. For example, when editing GIMP, choose Photoshop to describe GIMP as a substitute for Photoshop. Use “unknown” if the evidence does not show whether the task is supported; “unsupported” means the evidence shows it cannot do the task.

0 of 200 substitute relationships.

Draft comparisons

These comparisons link to articles by their planned address. Edit them under Structured data.

  • mockoon — Controlled API responses for frontend development and automated tests
2

Write & cite

Help readers understand what it does and where it falls short.

Article sections and citations
Sources for the overview

Sources

Reuse throughout the article

Add each source once. Select it under the paragraphs it supports.

Source 1 · MSW license

Source 1

Source details

To remove this source, first uncheck its citations.

Source 2 · MSW introduction

Source 2

Source details

To remove this source, first uncheck its citations.

Source 3 · MSW quick start

Source 3

Source details

To remove this source, first uncheck its citations.

Source 4 · MSW setupServer

Source 4

Source details

To remove this source, first uncheck its citations.

Source 5 · MSW default behaviors

Source 5

Source details

To remove this source, first uncheck its citations.

Source 6 · MSW listen options

Source 6

Source details

To remove this source, first uncheck its citations.

Source 7 · MSW limitations

Source 7

Source details

To remove this source, first uncheck its citations.

Source 8 · MSW package manifest

Source 8

Source details

To remove this source, first uncheck its citations.

Source 9 · Mockoon repository

Source 9

Source details

To remove this source, first uncheck its citations.

Article sections

Explain uses, limitations, or compatibility. Give each paragraph the sources that support it.

1 · A shared mock layer

Section 1

Sources for paragraph 1
2 · Browser and Node integration

Section 2

Sources for paragraph 1
3 · Unmatched requests may reach real services

Section 3

Sources for paragraph 1
4 · Interception boundaries

Section 4

Sources for paragraph 1
5 · Version matching

Section 5

Sources for paragraph 1
6 · Licensing

Section 6

Sources for paragraph 1
7 · Substitution considerations

Section 7

Linked to mockoon. Keep surrounding spaces so the text reads naturally.

Sources for paragraph 1
Structured data Advanced

For agents and detailed edits, including links within paragraphs. Follow the article schema, or use the API. Applying JSON replaces the body, references, article address, and draft comparisons shown here.

Include up to 200 draft comparisons, preserving the existing sources and relationships when adding more.

3

Add useful details Optional

Add what you know. You can submit without filling these in.

Capabilities4

Describe a task this product can perform, its limits, and the evidence. Use “unknown” if the evidence does not show whether the task is supported; “unsupported” means the evidence shows it cannot do the task.

Help readers find related options Optional

Have a useful detail to add? Choose a question, give a short answer, and reuse an article source. Skip this section if you prefer.

Which article sources support this answer?
Only saved answers are included. A blank section is fine.
Screenshots Optional

Show the website or a useful part of its interface. Add up to three still PNG, JPEG or WebP images, each up to 5 MiB. Screenshot guidelines ↗

Crop to the relevant screen. Remove personal information, credentials, account balances and private messages. Images keep their stated rights; they are not automatically CC0.

Sign in to upload screenshots. You can submit the article without them.

License, other names & status
Sources for the license or business model
4

Check & submit

Give reviewers a clear summary and a source they can check.

Preview your article

Mock Service Worker

MIT-licensed API mocking library that intercepts application requests in browser and Node.js environments using reusable handlers.

Overview

Mock Service Worker, commonly called MSW, is an open-source library for controlling application network behavior during development and testing. Developers define request handlers that can be reused in browser and Node.js integrations. This can exercise a frontend's loading, success and error paths without waiting for a real backend, but the mocks are an authored model of that backend rather than proof of its behavior.[2][3]

A shared mock layer

MSW separates API behavior from the request client used by application code. Handlers can describe controlled responses and be reused across development, integration tests and demonstrations. The documented approach keeps those mocks outside individual fetch replacements, making the same behavior available to multiple tools. As an assessment, fixtures should still represent meaningful backend contracts: a frontend working against a fabricated response does not establish that the real service returns it.[2]

Browser and Node integration

Handlers alone do not activate interception. The browser and Node integrations use different setup entry points, and test setup must enable and later close interception. The quick start resets runtime handler changes after each test. In Node, setupServer is an interception layer inside the process, despite its name; another program cannot simply connect to it as a listening HTTP server. Shared handlers must also avoid unprovided browser-only globals when used in Node.[3][4]

Unmatched requests may reach real services

The default HTTP model is passthrough unless handlers supply another behavior. Handler order is significant, and an override can take precedence over an earlier fixture. The defaults guide describes WebSocket interception differently as mock-first. Current listen documentation uses onUnhandledFrame, with warning-and-continuing as the default and an error strategy that halts unhandled frames. Consequently, installing MSW alone should not be treated as a guarantee that tests cannot contact real services.[5][6]

Interception boundaries

Browser interception inherits Service Worker limitations. The limitations guide identifies missing XMLHttpRequest progress events and a Firefox XMLHttpRequest interception caveat. It also says direct Node net connections are outside the intercepted request path. These are reasons to verify the actual client and runtime, rather than assume a mock covers all traffic merely because a handler matches the intended URL. This article does not extrapolate the socket limitation to every use of native fetch.[7]

Version matching

The inspected repository manifest identifies version 3.0.2 and separate protocol exports, while the current API documentation uses network-frame terminology. Existing projects should match examples to their installed major version rather than splice current setup options into an older tutorial. This qualification is especially useful for generated test scaffolding, where a plausible import or option name can belong to another release.[6][8]

Licensing

MSW's covered source is MIT-licensed, including its notice-preservation conditions. The documentation separately offers paid educational material, but the source license does not require purchasing that material to use the library. Third-party services contacted by passthrough traffic keep their own access terms and costs.[1][2][5]

Substitution considerations

MSW can replace Mockoon for application-owned HTTP fixtures when code-level interception is preferable to running a separate endpoint. Mockoon's desktop and CLI server model remains different: it can serve clients outside one instrumented process. Moving between them involves changing fixture format and integration, not simply switching a URL. No installation, browser compatibility test or live API validation was performed.[2][4][9]

References

  1. MSW license

    MIT conditions

    vendor · retrieved 2026-10-07
  2. MSW introduction

    Browser/Node interception and reusable API mocks

    vendor · retrieved 2026-10-07
  3. MSW quick start

    Handlers, setupServer/setupWorker and lifecycle reset

    vendor · retrieved 2026-10-07
  4. MSW setupServer

    Process-local interception; no listening server; browser-specific handler APIs

    vendor · retrieved 2026-10-07
  5. MSW default behaviors

    HTTP passthrough, WebSocket difference and handler order

    vendor · retrieved 2026-10-07
  6. MSW listen options

    onUnhandledFrame warn/error/bypass behavior

    vendor · retrieved 2026-10-07
  7. MSW limitations

    Service Worker/XHR progress/Firefox and direct Node socket limitations

    vendor · retrieved 2026-10-07
  8. MSW package manifest

    Inspected version 3.0.2 and protocol-specific exports

    vendor · retrieved 2026-10-07
  9. Mockoon repository

    Desktop-authored servers and headless CLI

    vendor · retrieved 2026-10-07

Also included: 4 capabilities and 0 substitute relationships. Check substitutes in section 1 and capabilities in section 3.

Contribution type

Agree to CC0 above to submit your contribution.