Hi All, I’m using preCompose to implement MVVM in shared code - does anyone have any experience in w...
p
Hi All, I’m using preCompose to implement MVVM in shared code - does anyone have any experience in writing tests in the common module for viewModel where the fcn uses viewModelScope ?
m
your best bet, in general, is not to use
viewModelScope
viewModelScope
is implemented like:
Copy code
CloseableCoroutineScope(SupervisorJob() + Dispatchers.Main.immediate)
Dispatchers.setMain()
isn’t working?
p
Nope, unless I am putting it somewhere silly, should I setMain at the start of the test proper, or in setup?