Testing the output of epics

Share this video with your friends

Send Tweet

Epics can be unit-tested just like any other function in your application - they have a very specific set of inputs (the action$ stream) and the output is always an Observable. We can subscribe to this output Observable to assert that the actions going back into the Redux are the ones we expect.

Marko
Marko
~ 7 years ago

In my case, the subscribe callback doesn't run, unless put output$.toArray().subscribe, but that's not what I want. Any idea why it only runs when toArray is put?

Solved... was doing ActionsObservable.of('ACTION_NAME') instead of passing the action object. ;)

Danut Codrescu
Danut Codrescu
~ 7 years ago

next lesson (mocking-an-ajax-request-when-testing-epics) does not load