-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Simplify async .rejects examples #8965
Conversation
The docs state that "If the promise is fulfilled, the test will automatically fail", so it is not necessary to include the `expect.assertions(1)` calls since the tests will fail automatically if the promise doesn't reject.
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
Codecov Report
@@ Coverage Diff @@
## master #8965 +/- ##
======================================
Coverage 64.2% 64.2%
======================================
Files 276 276
Lines 11718 11718
Branches 2868 2868
======================================
Hits 7523 7523
Misses 3563 3563
Partials 632 632 Continue to review full report at Codecov.
|
Thanks for bringing this up. In my opinion, it is still a good idea and should be recommended to use |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
That’s true, it would protect against forgetting to return the promise. However, for this example in particular, it made me question whether Maybe it would be better to update the text to say that |
Yeah, mentioning that it is recommended to prevent the common mistake of forgetting to await / return the expect.resolves sounds good to me! |
Please update the versioned docs as well when incorporating @jeysal's feedback 🙂 |
Looks like #9149 was merged in which addresses this PR! |
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. |
The docs state that "If the promise is fulfilled, the test will automatically fail", so it is not necessary to include the
expect.assertions(1)
calls since the tests will fail automatically if the promise doesn't reject.Summary
Test plan