Skip to content

Commit ee66670

Browse files
Jongmun-Parkthymikee
authored andcommitted
docs: remove expect.assertions(1) in rejects example of Tutoria… (#9149)
* 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
1 parent fafb5b7 commit ee66670

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/TutorialAsync.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ it('tests error with async/await', async () => {
140140

141141
## `.rejects`
142142

143-
The`.rejects` helper works like the `.resolves` helper. If the promise is fulfilled, the test will automatically fail.
143+
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.
144144

145145
```js
146146
// Testing for async errors using `.rejects`.

0 commit comments

Comments
 (0)