npm / nock
nock
What changed in nock 10 to 15, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-28.
13 breaking2 new APIs and options11 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initnock 155 changes
Breaking changes 1
Removes headers from Definition to align the type with runtime behavior.
Fixes and other changes 4
Supports @mswjs/interceptors 0.45 by streaming delayed bodies.
Added rawHeaders to Definition to align the type with runtime behavior.
replyContentLength counts bytes rather than characters, avoiding incorrect lengths for multibyte content.
Empty request bodies are no longer decompressed.
nock 148 changes
Breaking changes 1
Support for Node versions below 18 was dropped.
New APIs and options 1
Nock now supports native fetch.
Fixes and other changes 6
Calling nock.removeInterceptor now removes the interceptor from scope.interceptors.
The response handler now guards against requests aborted by an AbortSignal.
Reverts the change that applied body delay before the response end.
Applies the body delay before the response ends.
Prevents a crash when query params have conflicting dot-notation keys.
Updated @mswjs/interceptors to fix a memory leak.
nock 137 changes
Breaking changes 7
ClientRequest.abort() now aligns with Node's native behavior, with subtle differences that are not backwards compatible.
delay is now a setter instead of additive.
delayBody is now a setter instead of additive.
delayConnection is now a setter instead of additive.
Playback of mocked responses will not happen until the 'socket' event is emitted.
Scope.log has been removed; use the debug library when debugging failed matches.
socketDelay has been removed; use delayConnection instead.
nock 124 changes
Breaking changes 3
cleanAll() no longer returns the nock global.
Nock now requires Node 10 or later.
String constructor values are no longer recognized when checking types of strings; only string primitives are recognized.
New APIs and options 1
enableNetConnect() now accepts a function.
nock 102 changes
Breaking changes 1
Official support for Node versions below 6 is dropped; Node 4 usage may still work, but is no longer tested.
Fixes and other changes 1
Fixes handling of statusCode when there is no payload.