fetch-mock
Library for mocking calls to fetch in Node.js and browsers, supporting complex matchers, named routes and global/sandbox modes.
Our Verdict
Pragmatic fetch mocker that is fine until you outgrow it and want MSW-level fidelity.
Pros
- Mocks fetch in Node and browsers with one API
- Rich matchers, named routes and sandbox mode
- Works with Jest, Vitest, Mocha, Karma
- Easy restore semantics per test
Cons
- Another layer versus MSW service worker approach
- Global patching can leak between tests
- Docs structure is dense for newcomers
- Less realistic than intercepting at network level
When to Use fetch-mock
Good fit if you need
- Mock fetch calls in Node.js and browser test suites
- Named route matchers for complex URL pattern stubs
- Sandbox mode for test isolation without globals
- Simulate network errors and timeout scenarios
Pricing
Price wrong?fetch-mock Pricing
- Pricing Model
- free
- Free Tier
- Yes
- Entry Price
- β
- Enterprise Available
- No
- Transparency Score
- β
Beta β estimates may differ from actual pricing
Estimated Monthly Cost
$25
Estimated Annual Cost
$300
Estimates are approximate and may not reflect current pricing. Always check the official pricing page.
Project Health
Health Score
4
10 days
1d
13
N/A
MIT
Last checked: 2026-04-21
Lock-in Assessment
π Thinking about migrating off fetch-mock?
Get an AI-drafted migration plan + a copy-paste email to fetch-mock support requesting a data export. Pick where you're moving to and tell us your context.
Looking for alternatives to fetch-mock?
Answer 4 quick questions β get an AI-ranked shortlist of tools that match your stack and requirements.
Open AI Tool FinderCommunity Discussion
Comments powered by Giscus (GitHub Discussions). You need a GitHub account to comment.