Michael Solomon

Results 282 comments of Michael Solomon

@kettanaito I need clarification on what you have in mind. How is it different from what we currently have? ```js export async function handleRequest(options) { const handleResponse.. const handleResomposeError.. ......

Reopen this because current implementation does not propagate the error and destroy the socket yet. So, if we want to enable `errorWith({a:1});` we need to: 1. to remove the if...

@kettanaito Maybe things changed since you worked on it, but this is working to me: ```js const { FetchResponse } = require('./lib/node') const { ClientRequestInterceptor } = require('./lib/node/interceptors/ClientRequest') const http...

I think the problem is that the request "continues" to send the body, but on the `interceptors` side, we have already passed the body read phase. So nothing happened. The...

Note for future: maybe we can use `information` event: https://github.com/nodejs/node/blob/ac131bdc0155e3e928e781cc16198e883b01bef2/lib/_http_client.js#L718

Can you please remove the `stripe` dependency from your example?

Oh.. this is probably the problem. When you import `http` This way, we can't patch the `http` module. please change it in `stripe` module: More info/Similar question: https://github.com/nock/nock/discussions/2778

Thanks! Can you please provide a more straightforward example without `stripe`? I don't want to debug the `stripe` package.

@sonntag-philipp Yes.. this is a limitation of our current interception implementation. We can't `req.end` inside the `connect` event. As a workaround, you can explicitly call `req.flushHeaders` to make sure `nock`...

🎉 I'll close this one; we track this issue on the `msw/interceptors` repo.