typescript-sdk
typescript-sdk copied to clipboard
add interceptor for http clients
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?
@re-Tick Can you please review this?
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.