isahc icon indicating copy to clipboard operation
isahc copied to clipboard

feature request: mock client for testing

Open PoiScript opened this issue 4 years ago • 1 comments

Do you have any plans for implementing a mock client for unit testing?

I did notice that isahc have a middleware feature but it seems that we can't mock http requests.

PoiScript avatar Oct 29 '19 13:10 PoiScript

No plans currently, but this could be an interesting feature to discuss. Something planned is to replace the (unstable) middleware API with a better "interceptor" API that would allow you to early-return a response without actually making the request. When that is done, it should be possible to create a mock interceptor that returns mocked responses.

See #42 for interceptors.

sagebind avatar Oct 29 '19 15:10 sagebind