Paul Woitaschek
05/03/2019, 9:01 AMlaunch(Dispatchers.Main) { ... withTimeoutOrNull(1000) }
When I set that timeout to 0
, the tests passes because the views are ready.
Now I thought, that in my tests I can set the main dispatcher for advancing the time automatically (so that the timout is thrown immediately and don't need to adjust the production code for my tests):
Dispatchers.setMain(TestCoroutineDispatcher())
.
However that doesn't work.
Has someone and idea why and how I can fix it?Jonas Bark
05/03/2019, 10:08 AM