You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using mockFn.mockRejectedValue(value) causes a misleading unhandled rejection. This doesn't happen when using an equivalent mockFn.mockImplementation(fn), and is not immediately obvious why this happens.
If the current behavior is a bug, please provide the steps to reproduce and
either a repl.it demo through https://repl.it/languages/jest or a minimal
repository on GitHub that we can yarn install and yarn test.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
Do you want to request a feature or report a bug?
bug - I opened a PR to fix this
What is the current behavior?
Using
mockFn.mockRejectedValue(value)
causes a misleading unhandled rejection. This doesn't happen when using an equivalentmockFn.mockImplementation(fn)
, and is not immediately obvious why this happens.If the current behavior is a bug, please provide the steps to reproduce and
either a repl.it demo through https://repl.it/languages/jest or a minimal
repository on GitHub that we can
yarn install
andyarn test
.https://github.com/javinor/mock-rejected-value-causes-unhandled-rejection
What is the expected behavior?
To not throw an unhandled rejection
Please provide your exact Jest configuration and mention your Jest, node,
yarn/npm version and operating system.
Jest 22.4
Node v9.7.1
Mac OSX
The text was updated successfully, but these errors were encountered: