redux-saga-test-engine
redux-saga-test-engine copied to clipboard
Unable to pass `undefined` as mock return value
Currently an Env mapping is missing a value for...
error will be thrown when a mapping specifies undefined
as its return value, ie
[call(shouldReturnUndefined), undefined]
due to the check on line 164 of core.js
:
var nextValFound = nextVal !== undefined;
I believe undefined
is a valid return value, so this throw condition seems to be in error. The absence of a return value should instead be caught by isNestedArray
, which confirms the array has a length of 2.
My suggested fix would be to remove line 164 (happy to do a PR!), but raising an issue to confirm there's not some other reasoning behind this assertion.
@steevsachs I think that's a fair point. Happy to receive a PR on it! :-)