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
The comments at the top of the test still refer to try-catch, this is inconsistent with the code contained in the code snippets.
The PR only shows an example with .rejects which will only be available in Jest 20+. This should be mentioned in the docs to avoid confusion.
People using older versions of Jest will not be able to use this documentation. I think we should add back the explanation about using try-catch to catch Promise rejection (that was removed in PR Updated expect API docs with .resolves and .rejects #3172) for people using Jest 19 and below. This can live alongside the current docs using .rejects.
The example contained in the link examples/async links to testing examples like this. These examples still use the try-catch mechanism, this is inconsistent with the code examples currently contained in the docs. This is another reasons why we should add back the explanation of using try-catch to this section of the docs.
The text was updated successfully, but these errors were encountered:
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.
PR #3172 updated the docs to include the new
.resolves
and.rejects
keywords for running assertions on Promises.I noticed that this PR introduced some inconsistencies in the updated Error Handling section of https://github.com/facebook/jest/blob/master/docs/TutorialAsync.md. There is a screenshot of this section below:
try-catch
, this is inconsistent with the code contained in the code snippets..rejects
which will only be available in Jest 20+. This should be mentioned in the docs to avoid confusion.try-catch
to catch Promise rejection (that was removed in PR Updated expect API docs with .resolves and .rejects #3172) for people using Jest 19 and below. This can live alongside the current docs using.rejects
.examples/async
links to testing examples like this. These examples still use thetry-catch
mechanism, this is inconsistent with the code examples currently contained in the docs. This is another reasons why we should add back the explanation of usingtry-catch
to this section of the docs.The text was updated successfully, but these errors were encountered: