Mock Service Worker alternatives

The closest alternatives to Mock Service Worker are Mirage JS, Nock and Mockttp. Stay with Mock Service Worker when: Frontend tests and demos that need realistic API responses.

Mirage JS

Choose it over Mock Service Worker whenChoose it when your frontend mock needs an in-memory database with records and relationships.

Mirage JS defines mock routes and lets handlers access an in-memory database backed by models. Its guide shows how to declare relationships and seed records for development, and describes how its test environment loads the routes without applying those seeds (overview).

miragejs.com ↗Source ↗Checked 29 November 2026

Nock

Choose it over Mock Service Worker whenChoose it when Node.js tests need to assert that specific outbound HTTP calls occurred.

Nock intercepts HTTP requests in Node.js and lets tests set expectations for matching calls. Check an individual scope with scope.isDone() to see whether its expected requests occurred, or inspect pending mocks to find calls the test never made (repository documentation). The licence is MIT (repository licence).

MIT

github.com ↗Source ↗Checked 29 November 2026

Mockttp

Choose it over Mock Service Worker whenChoose it when a JavaScript test needs a local HTTP server and wants to inspect requests it receives.

Mockttp starts a local mock HTTP server and lets JavaScript tests register method and path rules. Its examples use .thenReply() to return a response and getSeenRequests() to retrieve requests received by a configured endpoint (repository documentation). The licence is Apache-2.0 (repository licence).

Apache-2.0

github.com ↗Source ↗Checked 29 November 2026

WireMock

Choose it over Mock Service Worker whenChoose it when callers need a separate HTTP stub server configured with JSON mappings.

WireMock can return configured responses when requests match stub mappings. Its stubbing guide shows how to register a mapping using JSON and set the response status, body and headers. It also documents priorities for cases where multiple stubs match a request (stubbing).

wiremock.org ↗Source ↗Checked 29 November 2026