Skip to content

Commit

Permalink
docs: update readme, split async test
Browse files Browse the repository at this point in the history
Application of feedback
#315 (comment)
  • Loading branch information
GerkinDev committed Oct 6, 2021
1 parent 94423c6 commit 2497be4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,14 @@ test('throws an error of type TypeError with message "hello world"', () => {
});
```

This works for promise rejections too.

```js
test('throws an error of type TypeError with message "hello world"', async () => {
await expect(Promise.reject(new TypeError("hello world async")).rejects.toThrowWithMessage(TypeError, /hello world/);
});
```
### Mock
#### .toHaveBeenCalledBefore()
Expand Down

0 comments on commit 2497be4

Please sign in to comment.