https://kotlinlang.org logo
#orbit-mvi
Title
# orbit-mvi
m

Mikolaj

12/07/2023, 9:29 AM
what is the difference between
awaitItem
and
awaitState
in test framework? I did discover that when I use
skipItems
or
awaitItem
in a test followed by
expectState {}
the state inside of
expectState
block does not update. Is it desired behavior?
m

Mikolaj Leszczynski

12/11/2023, 5:59 PM
awaitItem
awaits (and returns) either a side effect or a state
awaitState
awaits (and returns) only a state
expectState
will both await and allow you to verify the captured state within its block When you
await
it is assumed you want to capture and manually assert the state, versus using
expectState
where you can easily assert a
copy
of the state - so the state is consumed and you don't see an update in
expectState
👀 1
m

Mikolaj

12/11/2023, 6:00 PM
Thank You! 🙌 makes sense
And what about
skipItems
? why doesen't it update the state that is later captured in
expectState
?
m

Mikolaj Leszczynski

12/12/2023, 9:50 AM
skipItems
also skips states
👍 1