I have the following in an Epic:
mergeMap(result => concat(
of(fetchDone(result)),
of(dispatchActions(payload))
))
And actions:
const fetchDone = result => ({ type: "FETCH_DONE", payload: result });
function dispatchActions(payload) {
return dispatch => {
dispatch(doStuff(payload));
...
};
}
The issue is in my test using marbles, I need to be able to check for the anonymous function because dispatchActions
is seen as anonymous. How do I do that?
const values = {
...
b: { type: "FETCH_DONE", payload: expected },
c: NEEDS TO BE ANONYMOUS
};
...
const output$ = fetchApi(action$, state$);
// This fails due to the anonymous function
expectObservable(output$).toBe('---(bc)--', values);