Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Plaid - ShowViewModelTest
fun loadShot_emitsTwoUiModels() {
// When the ViewModel has started
val viewModel = ... // Creates viewModel
// Then the fast result has been emitted
val fastResult = viewModel.shotUiModel.getOrAwaitValue()
// THIS FAILS!!! The slow result has already been emitted because the coroutine
// was executed immediately and shotUiModel LiveData contains the slow result
// And then, the slow result has been emitted
val slowResult = viewModel.shotUiModel.getOrAwaitValue()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.