I am running a unit test on a coroutine with `Disp...
# coroutines
h
I am running a unit test on a coroutine with
Dispatchers.Main
and I am getting
java.lang.IllegalStateException: Module with the Main dispatcher had failed to initialize
I can provide
Dispatchers.Main
externally or use Roboelectric but is there anything else that I can do?
p
Right now you have to switch
Main
with non-android dependent dispatcher yourself through the DI while running tests. There is an open proposal to make it possible to switch globally https://github.com/Kotlin/kotlinx.coroutines/issues/746
h
yeah this would make sense