Closed mikicho closed 2 months ago
Update: the response behavior isn't identical to the original response. IncomingMessage
and PassThrough
act differently on destroy
@kettanaito Why do we skip properties if they have the same name? The implementation may be still different If I delete these lines my test passes because it calls to the correct implementation.
This has been released in v0.32.1!
Make sure to always update to the latest version (npm i @mswjs/interceptors@latest
) to get the newest features and bug fixes.
Predictable release automation by @ossjs/release.
According to docs,
response.destroy(err)
emitserror
event.:https://github.com/nodejs/node/blob/main/lib/internal/streams/destroy.js#L136
Nock handles this by overriding the Socket class and propagate the event to the request.
@kettanaito I tried to open a PR for this but couldn't understand how to do this, but I believe I'll be able to with your direction.