Creates a matcher function for toThrow or toThrowError.
toThrow
toThrowError
The name of the matcher, either "toThrow" or "toThrowError".
Optional
If true, the matcher will handle promises and check for errors thrown from promises.
A matcher function.
Creates a matcher function for
toThrowortoThrowError.