Skip to content

Conversation

@haines
Copy link
Contributor

@haines haines commented Feb 27, 2019

jest-when has the same issue as jestjs/jest#5721 (which was fixed in jestjs/jest#5720) - mockRejectedValue causes an error if the mock function is called asynchronously, because the returned promise was rejected immediately.

This PR changes mockRejectedValue[Once] to defer the promise rejection until the mock function is actually called.

@timkindberg timkindberg merged commit a78928e into timkindberg:master Feb 27, 2019
@timkindberg
Copy link
Owner

Thanks! v2.3.1

@haines haines deleted the defer-promise-rejection branch February 27, 2019 19:54
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 this pull request may close these issues.

2 participants