what is the difference between `awaitItem` and `aw...
# orbit-mvi
m
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
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
Thank You! 🙌 makes sense
And what about
skipItems
? why doesen't it update the state that is later captured in
expectState
?
m
skipItems
also skips states
👍 1