Skip to content

Commit

Permalink
docs: remove expect.assertions(1) in rejects example of Tutoria… (#9149)
Browse files Browse the repository at this point in the history
* docs: remove expect.assertions(1) in rejects example of TutorialAsync.md

* docs: add a comment for expect.assertions(1) in rejects example of TutorialAsync.md

* docs: add a comment for expect.assertions(1) in rejects example of TutorialAsync.md

* fix a comment

* fix a comment

* fix a comment
  • Loading branch information
Jongmun-Park authored and thymikee committed Nov 20, 2019
1 parent fafb5b7 commit ee66670
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/TutorialAsync.md
Expand Up @@ -140,7 +140,7 @@ it('tests error with async/await', async () => {

## `.rejects`

The`.rejects` helper works like the `.resolves` helper. If the promise is fulfilled, the test will automatically fail.
The`.rejects` helper works like the `.resolves` helper. If the promise is fulfilled, the test will automatically fail. `expect.assertions(number)` is not required but recommended to verify that a certain number of [assertions](https://jestjs.io/docs/en/expect#expectassertionsnumber) are called during a test. It is otherwise easy to forget to `return`/`await` the `.resolves` assertions.

```js
// Testing for async errors using `.rejects`.
Expand Down

0 comments on commit ee66670

Please sign in to comment.