It's been a while since the last new article on my blog... But I've just published a new one about testing StateFlows and dealing with conflation!

https://zsmb.co/conflating-stateflows/

Fun fact: this has been researched and written in large part during various train rides! 🚆

The conflation problem of testing StateFlows

StateFlow behaves as a state holder and a Flow of values at the same time. Due to conflation, a collector of a StateFlow might not receive all values that it holds over time. This article covers what that means for your tests.

zsmb.co

@zsmb13

I'm so excited to read your blogs again! 

@zsmb13 can this situation be avoided if we use Compose State primitives instead of a StateFlow? For example to use something like Molecule but instead of going State -> StateFlow -> State just observing the original State in a Compose UI, and then somehow also inspecting it in a Test (not sure how though)?