Open ferenckv opened 7 years ago
This scenario is not working:
const fail = function(action$) { return action$.ofType('FAIL_ACTION').map(action => action.payload); } it('should fail', done => { const action = { type: 'FAIL_ACTION', payload: { test1: '123', test2: undefined, }, }; const expected = { test1: '123', }; const {fail} = require('../epics'); expectEpic(fail, { expected: ['a|', {a: expected}], action: ['a|', {a: action}], response: ['|'], done, }); });
It looks like the stringify here https://github.com/cmelion/redux-observable-test-helpers/blob/master/src/epic-helper.js#L50 is not considering the undefined value.
stringify
undefined
Also, here https://github.com/cmelion/redux-observable-test-helpers/blob/master/src/epic-helper.js#L60 there should be a try... catch block with a console.log reporting the error, otherwise it only shows an error related with the async callback not being called, without any usefull information.
try... catch
console.log
Did you want to issue a pull-request?
This scenario is not working:
It looks like the
stringify
here https://github.com/cmelion/redux-observable-test-helpers/blob/master/src/epic-helper.js#L50 is not considering theundefined
value.Also, here https://github.com/cmelion/redux-observable-test-helpers/blob/master/src/epic-helper.js#L60 there should be a
try... catch
block with aconsole.log
reporting the error, otherwise it only shows an error related with the async callback not being called, without any usefull information.