Closed taiju59 closed 4 years ago
Issue-Label Bot is automatically applying the label question
to this issue, with a confidence of 0.82. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!
Links: app homepage, dashboard and code for this bot.
Hi, no worries about your English, it's perfect. And as to your question, right now there's no way to mock it, I am currently working on making the library better and compatible with the much needed testing we all want. If you want I can let you know when I've added it via email or GitHub as well. Thanks for the comments and suggestions.
@CodingAleCR Thank you for quick reply! OK, I understand. So I want to request feature to inject client instance. If it might be good, I will create PR.
Should I create new issue?
I will add it to the roadmap since I keep it separately from the repository in GitHub. I will however link back the PR to this issue once it's ready. Thanks! 🎉
Hello, I want to mock http response.
Like
MockClient
. (in http package)But
_client
instance inHttpClientWithInterceptor
is final, private and initialized in field, so it's not injectable.Then, I tried to mock with
InterceptorContract
.But
interceptRequest
can't modify response. AndinterceptResponse
can't stop request, so (real) request thrown. I want to mock without connecting to the internet.Is there any way to mock http response?
(If I can't, I request feature to inject client instance.)
Sorry for my poor English, Thanks.