For my tests I am trying to mock an event stream with Observable.of()
but when I try
const actions$ = Observable.of({});
...
// in the function that is tested
actions$
.filter(action => action.type === 'LOAD_REQUEST')
.first()
.subscribe(() => { ... do something });
I get the following error
EmptyError: no elements in sequence in xxx.js
This only occurs when I use .first()
.
How can I mock the event stream so the tests don't fail?