'Jetpack compose UI tests mockking MutableState

I am trying to combine jetpack compose UI testing with mockk. But have some issues when the state changes it gives me an error:

io.mockk.MockKException: no answer found for: SignInViewState(child^2 of #1#2#3).copy(0, false, false, null, null, NotFocused, null, null)

How should I handle the state when using mockk. The error requires me to have an "answer" for my state which I don't really want but if I do what is the correct way of doing it?

every {
   signInViewModel.viewState.value
} answers {
   // Not sure what to put here        
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source