This repository was archived by the owner on May 15, 2021. It is now read-only.
Tags: Tryweirder/nock
Tags
fix(playback): consistently check for `destroyed` attribute (nock#2152) Node, as of 14.1, started migrating the Client Request terminology from `aborted` to `destroyed`. In order to supported our current Node version support, 10.x+, we need to check both flags. Nock was already doing this in the router, but not during playback.
fix(socket): add encrypted attribute for secure requests (nock#2149) https://nodejs.org/docs/latest/api/tls.html#tls_tlssocket_encrypted https://github.com/nodejs/node/blob/295e766c2782d6d83e33004f7c2204c0a8d52655/lib/_tls_wrap.js#L507-L509
fix(overrider): allow calling empty `req.end` multiple times Node source showing this is expected behavior: https://github.com/nodejs/node/blob/39a7f7663e8f70fc774105d8fa41b8e4cc69149f/lib/_http_outgoing.js#L816 Two tests were added, one for the regression itself, and one to fix coverage for a block that lost coverage when the bug was patched.
fix: Parallel requests on same Interceptor are exposed correctly in r… …eply functions (nock#2056) Fixes regression created in nock#2033. Reply functions get access to the current request via the Interceptor, which acts as the context during the function executions. The previous change, incorrectly moved the line where the request was attached to the Interceptor up in the flow and out of the same microtask that calls the reply functions. Causing requests in parallel to lose the reference to the correct request.
fix: data comparison with undefined object values (nock#2049) Updates the `dataEqual` utility and underlying `deepEqual` recursive functions to treat explicit and implicit `undefined` object values as equal. Also ensures that `expand` is only called on top-level data if they're plain objects, thus avoiding accidentally equating an object and an array if the object's keys happen to be integers.
fix(intercept): mark Interceptors consumed immediately (nock#2033) When an request is matched to an Interceptor, mark it consumed immediately so that similar requests made in parallel don't get matched incorrectly. This changes the behavior of aborted requests slightly. Previously, an Interceptor was marked consumed just prior to the "response" event. Now it will be marked consumed just prior to the "finished" event. The change can only be noticed if a request is aborted while in a "finished" listener.
PreviousNext