# wheresrhys/fetch-mock

Mock http requests made using fetch

Repository: https://github.com/wheresrhys/fetch-mock
Canonical: https://ross.abutalabs.com/products/fetch-mock
Homepage: http://www.wheresrhys.co.uk/fetch-mock/
Language: JavaScript
License: MIT
License Family: permissive
Last push: 2026-08-18T15:26:22+00:00

## Health v2 (maintenance only)
Score: 83/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 98, release rhythm 54, longevity 100
- inputs: {"age_days": 4143, "days_push": 15, "days_rel": 307, "gap_med": 6.0, "n_releases_24m": 19}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1309, forks 191 (observed 2026-08-28T04:04:19.478390+00:00)

## What it is
fetch-mock is a JavaScript library for mocking HTTP requests made with the fetch API, with an intuitive API for routing mocks based on request criteria. It runs in environments from Node.js to service workers and is compatible with most testing frameworks.

## Use cases
- mock fetch requests in unit tests
- simulate different HTTP responses based on URL or criteria
- test code that calls the fetch API in node
- intercept fetch calls in service workers
- stub network responses for frontend testing

## When to choose
- your code uses the fetch API and you need deterministic tests
- you need fine-grained routing of mocked responses by URL, method, or other criteria
- you need a mock that works across node, browsers, and service workers

## When to avoid
- your code uses axios or another XHR-based client rather than fetch
- you need full end-to-end tests against a real server
- you want automatic request recording/replay rather than hand-written mocks

## Facets
- artifact type: library
- maturity: active
- function: mocking, http-client, testing
- domain: testing, web-development, developer-tools
- platform: browser, cross-platform
- tags: fetch-api, http-mocking, test-utilities, service-workers, monorepo, nodejs, javascript

## Member repositories
- wheresrhys/fetch-mock (main) score 83

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:19.478390+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:50:02.170959+00:00, confidence not recorded.
  - readme: https://github.com/wheresrhys/fetch-mock (fetched 2026-08-28T04:04:19.478390+00:00, sha 92ddbe6585fc)
  - homepage: http://www.wheresrhys.co.uk/fetch-mock/ (fetched 2026-08-29T12:08:32.099115+00:00, sha 9a5f16916fae)
- Data as of 2026-08-30T08:39:29.467469+00:00.
