Closed tsuba3 closed 5 years ago
Hey there -- in this case, rather than doing two separate assertions on the same stream, it's usually easier to use the emitsInOrder
operator, so you don't run into timing issues like this.
E.g.
bloc.submit();
expect(bloc.isSubmitting, emitsInOrder([true, false]);
Heya @tsuba3, gonna close this out for now, but let let me know if my suggestion didn't work for ya!
I use ValueObservable in Flutter development with BLoC pattern. For testing, I want to cast a ValueObservable as a single-subscription stream, or detect that the bloc add something new into a ValueObservable.
For example: