typescript-sdk icon indicating copy to clipboard operation
typescript-sdk copied to clipboard

add interceptor for http clients

Open Ramanjs opened this issue 2 years ago • 4 comments

Hi @re-Tick, I was thinking about the process to intercept all HTTP requests, so I wrote up a quick prototype of how we could do this using @mswjs/interceptors package by reusing code from the node-fetch integration. It is intercepting and recording mocks for Axios but has a little problem in converting the response body readable stream to string right now. I'll try to figure that part out, but what do you think about the overall structure?

Ramanjs avatar Mar 14 '23 16:03 Ramanjs

@re-Tick Can you please review this?

developer-diganta avatar Mar 18 '23 05:03 developer-diganta

Hi @Ramanjs, the structure looks good to me. We have to pass the ctx to the ProcessDep as an argument to mock/capture the outputs.

re-Tick avatar Mar 19 '23 09:03 re-Tick