felangel/bloc.js

[Question] How to proper test bloc.js

Lonli-Lokli opened this issue ยท 3 comments

As a continuation of previous issue, There some async blocs.

What are the possible ways to write verification tests that with the given initial state and input event I will get known number of output states, ended with some specific one?

Hi @Lonli-Lokli ๐Ÿ‘‹
Thanks for opening an issue!

You can check out the bloc tests at

it('has correct state after a multiple events are added', async done => {
for an example. Let me know if that helps ๐Ÿ‘

Thanks! So with your proposal it's required to complete the bloc stream.

@Lonli-Lokli yup so that you know for sure that no more states are emitted ๐Ÿ‘