-
-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using Okhttp with checker in unit-tests #977
Comments
You should not use Chucker in unit tests as it will attempt to show UI components which most likely you won't have in your test environment. As you said, you should have a more streamlined OkHTTP client for tests only that doesn't contain Chucker |
It's not chucker's responsibility to know the context in which it's being executed (i.e. in your unit test); it's your app's responsibility to ensure that Chucker isn't installed/configured as part of your unit test suite |
Chucker works under the assumption that there is an Android |
✍️ Describe the bug
I'm using Dagger for injection and in some places in the unit tests I used injection too.
By adding the chucker into my OKHttp some of my unit tests start to fail because of the checker. I don't have different component for tests which is recommended as I understand, But I'm wondering the reason that chucker make an issue with tests in this case, and maybe a solution for it because changing into my current dagger flow is really hard and I'm trying to avoid it for now.
💣 Steps to reproduce
🔧 Expected behavior
Why Chucker has a problem with unit tests, and a solution to fix it.
📱 Tech info
The text was updated successfully, but these errors were encountered: