Correct erroneous rejects test example#6421
Conversation
as `rejects` will receive the rejected promise payload, not a function, resulting in the following error message when the test was run: `Received value must be a function, but instead "object" was found`
Codecov Report
@@ Coverage Diff @@
## master #6421 +/- ##
=========================================
Coverage ? 63.48%
=========================================
Files ? 227
Lines ? 8697
Branches ? 3
=========================================
Hits ? 5521
Misses ? 3175
Partials ? 1Continue to review full report at Codecov.
|
|
|
||
| To connect your watch plugin to Jest, add its path under `watchPlugins` in your Jest configuration: | ||
|
|
There was a problem hiding this comment.
This change is from prettier 🤷♂️
|
Thanks for the PR! I think you're on an old version of Jest - this was fixed in #4884. |
|
Indeed, you're right! Sorry, was so sure we were on latest 😳 |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
as
rejectswill receive the rejected promise payload, not a function,resulting in the following error message when the test was run:
Received value must be a function, but instead "object" was foundTest plan
Run the examples in Jest:
Expected output:
Ran all test suites.