https://kotlinlang.org logo
#coroutines
Title
# coroutines
k

knthmn

03/17/2021, 8:34 AM
I found this article from 2019 talking about the best practice of injecting dispatchers so that tests work well. Is this still the state of things? Just confirming because it sounds a little weird to me. Is there no way to change all dispatchers provided by
Dispatchers
to a test dispatcher when testing? https://craigrussell.io/2019/11/unit-testing-coroutine-suspend-functions-using-testcoroutinedispatcher/
w

wasyl

03/17/2021, 8:37 AM
Generally, yes
🙌🏼 1
There is https://github.com/Kotlin/kotlinx.coroutines/issues/1365 open which I believe would change this
🙌🏼 1
k

knthmn

03/17/2021, 9:54 AM
Turns out there are other issues preventing me from using runBlockingTest anyway. https://medium.com/@eyalg/testing-androidx-room-kotlin-coroutines-2d1faa3e674f
5 Views