Skip to content

Commit

Permalink
Added a note about the type of value thrown
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve authored and thymikee committed May 2, 2020
1 parent ea04be5 commit 0b8729e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/ExpectAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -1208,7 +1208,7 @@ 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.
> Note: You must wrap the code in a function, otherwise the error will not be caught and the assertion will fail. Furthermore, `.toThrow` will check that the value thrown is the instance of the Error class, and if not it will not be detected.
You can provide an optional argument to test that a specific error is thrown:

Expand Down

0 comments on commit 0b8729e

Please sign in to comment.