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 #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 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.Is it possible to try out jest 20.0.0+ for those new keywords?
I am not sure when jest 20 will be released but I hope soon:)
I think this is now resolved with #3201. If you think there is more we can do here, please send a PR :)
Most helpful comment
I am not sure when jest 20 will be released but I hope soon:)