Michael Solomon
Michael Solomon
Another example here: https://github.com/mswjs/interceptors/issues/492#issue-2044075571
@kettanaito It seems like the input validation is the first thing Node does before trying to write into the socket ([source](https://github.com/nodejs/node/blob/main/lib/_http_outgoing.js#L930)) so we can do something like: ```js class NodeClientRequest...
I don't want to forget what I did here (or that I did lol), so I opened a PR: https://github.com/mswjs/interceptors/pull/493 Happy holidays :)
I discovered that by wrapping the second call with `setImmediate`, the likelihood of missing the `timeout` event significantly increases. ```js const { ClientRequestInterceptor } = require('@mswjs/interceptors/ClientRequest') const http = require('http');...
A bit more context from the docs: > For efficiency reasons, Node.js normally buffers the request headers until request.end() is called or the first chunk of request data is written....
Thanks for the info! Very insightful! From my POV, this is insignificant; we can leave this open and tackle it later. > do you happen to know how Nock supports...
Yes. It does solve it. Thanks! I focus on fixing nocks tests, so I'll open a PR later.
@kettanaito Eventually we didn't fix this in [https://github.com/mswjs/interceptors/pull/454](https://github.com/mswjs/interceptors/pull/454). Can you please reopen this?
As written in the README file, `nock` is currently specific for Node.js, it may change in the future (https://github.com/nock/nock/pull/2517). Feel free to repoen.
@gr2m maybe can we use [`mswjs interceptors`](https://github.com/mswjs/interceptors) as the mocking mechanism and just expose the delightful Nock's API and behavior on top of it? Do you think it will reduce...