# Mocking and test data

Fake APIs, functions and data in tests. Scores run from 0 to 10 and are the mean of the scores of AI reviewers (Claude Opus 5.5, GPT-6.2 Sol), made on 22 November 2026 from GitHub, npm, OSV, OpenSSF Scorecard, ecosyste.ms, Hacker News and Bluesky data and a web search. The ecosyste.ms count of repositories that use a project is far too low for projects that grew in the last few years, and some reviews quote it. Overall is the reviewers' own judgement for a new project today, not an average of the parts. An AI wrote them and can be wrong.

| Rank | Project | Overall | Needed by many | Helps a lot | Holds up over time | Used widely | Vouched for | Safe | Best for |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 1 | [Mock Service Worker](https://elestia.ai/opensource/mocking/msw/index.md) | 8.5 | 6.6 | 8.6 | 7.7 | 7.6 | 8.4 | 7.4 | Web and full-stack TypeScript teams that want one set of network mocks for unit tests, browser tests, Storybook and local development. |
| 2 | [Faker](https://elestia.ai/opensource/mocking/faker/index.md) | 8.1 | 6.5 | 8.6 | 8.0 | 6.9 | 7.0 | 7.7 | Any JS/TS project that needs realistic, locale-aware, seedable fake data for tests, fixtures, database seeds or demos. |
| 3 | [Nock](https://elestia.ai/opensource/mocking/nock/index.md) | 7.1 | 4.9 | 7.6 | 6.7 | 6.8 | 6.5 | 7.5 | Node.js backend, CLI and SDK test suites that want short, strict HTTP request expectations and a recorder, with no browser tests. |
| 4 | [Mockttp](https://elestia.ai/opensource/mocking/mockttp/index.md) | 6.9 | 3.9 | 7.9 | 7.2 | 3.8 | 5.0 | 6.5 | Teams writing end-to-end or integration tests that must mock or rewrite real HTTP(S) traffic from separate processes, browsers or devices through a proxy. |
| 5 | [Sinon.JS](https://elestia.ai/opensource/mocking/sinon/index.md) | 6.9 | 5.9 | 7.4 | 7.1 | 7.1 | 6.9 | 7.7 | Teams on Mocha, node:test or another runner without built-in mocks who want mature spies, stubs and fake timers that work with any framework. |
| 6 | [Fishery](https://elestia.ai/opensource/mocking/fishery/index.md) | 6.5 | 4.3 | 7.4 | 5.2 | 3.8 | 5.3 | 7.6 | TypeScript teams that want typed, overridable factories for test objects, usually used together with Faker. |
| 7 | [fetch-mock](https://elestia.ai/opensource/mocking/fetch-mock/index.md) | 5.7 | 5.3 | 6.8 | 5.3 | 5.0 | 4.4 | 6.8 | Teams that want light, function-level stubbing of fetch in Jest, Vitest or the browser without setting up a mock server. |
| 8 | [JSON Server](https://elestia.ai/opensource/mocking/json-server/index.md) | 5.6 | 5.0 | 6.0 | 4.1 | 5.8 | 4.4 | 5.7 | Frontend developers who need a throwaway local REST backend from a JSON file for prototypes, demos or workshops. |
| 9 | [testdouble.js](https://elestia.ai/opensource/mocking/testdouble/index.md) | 5.4 | 4.8 | 6.6 | 5.9 | 3.2 | 3.9 | 6.6 | Teams doing outside-in TDD on Node who want a strict when/verify API that works with any test runner and can replace ES modules. |
| 10 | [Mirage JS](https://elestia.ai/opensource/mocking/miragejs/index.md) | 4.1 | 4.8 | 5.9 | 2.3 | 3.8 | 4.1 | 5.9 | Front-end teams that want a stateful, relational fake backend for prototypes or demos, or that already have a large Mirage setup. |

## The numbers

| Project | Downloads, 4 weeks | In a year | GitHub stars | Commits, 12 months | Last npm release | Advisories, 24 months |
| --- | --- | --- | --- | --- | --- | --- |
| Mock Service Worker | 135M | ×4.7 | 18k | 123 | Nov 2026 | 0 |
| Faker | 100M | ×2.6 | 16k | 482 | Aug 2026 | 1 |
| Nock | 34M | +74% | 13k | 32 | Nov 2026 | 0 |
| Mockttp | 2.6M | ×2.4 | 889 | 135 | Oct 2026 | 0 |
| Sinon.JS | 55M | +58% | 9.8k | 117 | Jul 2026 | 0 |
| Fishery | 6.2M | ×3.0 | 1k | 5 | Dec 2025 | 0 |
| fetch-mock | 6.2M | +44% | 1.3k | 82 | Oct 2025 | 0 |
| JSON Server | 1.7M | +23% | 76k | 60 | Mar 2026 | 0 |
| testdouble.js | 579k | −18% | 1.4k | 51 | Oct 2026 | 0 |
| Mirage JS | 1.6M | +41% | 5.5k | 0 | Oct 2023 | 0 |

All categories: https://elestia.ai/opensource/index.md
