Skip to content

Commit

Permalink
Improve docs (#4478)
Browse files Browse the repository at this point in the history
  • Loading branch information
diegofaria authored and cpojer committed Sep 13, 2017
1 parent c4844a6 commit 105f7db
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/en/ExpectAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,8 @@ test('throws on octopus', () => {
});
```

> Note: You must wrap the code in a function, otherwise the error will not be caught and the assertion will fail.
### `.toThrowErrorMatchingSnapshot()`

Use `.toThrowErrorMatchingSnapshot` to test that a function throws an error matching the most recent snapshot when it is called. For example, let's say you have a `drinkFlavor` function that throws whenever the flavor is `'octopus'`, and is coded like this:
Expand Down

0 comments on commit 105f7db

Please sign in to comment.