isahc
isahc copied to clipboard
feature request: mock client for testing
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.
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.