nock/nock
HTTP server mocking and expectations library for Node.js observed · 2026-08-28
Health v2 · maintenance only
96/100
- Activity 96
- Release rhythm 95
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: 14.0
- age_days: 5459
- days_rel: 34
- days_push: 29
- n_releases_24m: 19
Adoption not part of the score
13121 stars · 764 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-29, confidence not recorded
Nock is an HTTP server mocking and expectations library for Node.js. It intercepts HTTP requests made by code under test and returns predefined responses, enabling isolated testing of modules that perform HTTP requests.
Use cases
- mock HTTP requests in Node.js unit tests
- test a module that calls a third-party API in isolation
- simulate API error responses and delays in tests
- assert that expected HTTP requests were made
- test code that talks to CouchDB or AWS without hitting real services
When to choose
- you write Node.js tests for code that makes HTTP requests
- you need deterministic, offline tests without real network calls
- you want to assert request counts, headers, bodies, and query strings
When to avoid
- you are testing in a browser environment rather than Node.js
- you need to mock non-HTTP protocols like gRPC or WebSockets
- you want end-to-end tests against a real or containerized server
Facets
library · maturity stable
mocking testing http-client testing developer-tools apis web-development http-mocking unit-testing request-interception test-isolation nodejs javascript
1 source
- readme: https://github.com/nock/nock · fetched 2026-08-28 · dbcf63f42830
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| nock/nock | main | 96 |
For agents
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem