Any ideas why this test fails <
# coroutines
Any ideas why this test fails with
Wanted but not invoked interactions with this mock
. Thanks in advance!
It's testing this block in view model
Copy code
viewModelScope.launch {
  val flow = userRepository.getUserRepos(login)
  _userRepos.value = flow
    .catch { _isUserReposError.value = true }
I think I see the issue—incorrectly declaring channel.
Hmm still no luck. Something to do with
and how the test is written
I ended up revising the view model and emitting items as they come in instead of converting to a list (similar to Observable/Flowable in RxJava).
.catch { _isUserRepoError.value = true }
.collect { _userRepo.value = it }
đź‘Ť 1