Erik
02/11/2020, 3:54 PMTestCoroutineDispatcher
or TestCoroutineScope
, then any exceptions are swallowed (although the stack traces are printed). What is the general pattern to work with expected exceptions in unit tests and coroutines on Android?Andrew
02/12/2020, 2:41 AMErik
02/12/2020, 8:33 AMDispatchers.Main
is replaced in the tests dispatcher. I have verified this by simply printlnI(Dispatchers.Main)
, which prints some TestMainDispatcher@2812cbfa
instance.Andrew
02/12/2020, 4:46 PMErik
02/12/2020, 7:33 PMlaunch
) coroutine. So my coroutine will now handle the exception by propagating that information through other mechanisms unrelated to coroutines and exceptions.