Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to pass undefined as mock return value #41

Open
steevsachs opened this issue Aug 2, 2018 · 1 comment · May be fixed by #47
Open

Unable to pass undefined as mock return value #41

steevsachs opened this issue Aug 2, 2018 · 1 comment · May be fixed by #47

Comments

@steevsachs
Copy link

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.

@timbuckley
Copy link
Owner

@steevsachs I think that's a fair point. Happy to receive a PR on it! :-)

steevsachs added a commit to steevsachs/redux-saga-test-engine that referenced this issue Aug 3, 2018
* getNextVal now returns object { found, nextVal }
Resolves timbuckley#41
timbuckley pushed a commit that referenced this issue May 4, 2019
* getNextVal now returns object { found, nextVal }
Resolves #41
@timbuckley timbuckley linked a pull request May 4, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants