How to test composables with ViewModels with flows inside the viewmodels that run in viewModelScope?
If I use
Dispatchers.setMain(UnconfinedTestDispatcher)
the android tests time out and If i remove the line the JVM/Desktop tests fail and ask me to use
Dispatcherrs.setMain(UconfinedTestDispatcher)
Copy code
@BeforeTest
fun setUp() {
// This fails android but commenting it fails jvm because of the coroutines in BalanceViewModel
Dispatchers.setMain(UnconfinedTestDispatcher())