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 AMAndrew
02/12/2020, 2:45 AMErik
02/12/2020, 8:33 AMErik
02/12/2020, 8:35 AMDispatchers.Main is replaced in the tests dispatcher. I have verified this by simply printlnI(Dispatchers.Main), which prints some TestMainDispatcher@2812cbfa instance.Erik
02/12/2020, 8:38 AMErik
02/12/2020, 8:42 AMAndrew
02/12/2020, 4:46 PMAndrew
02/12/2020, 5:03 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.