expect
expect copied to clipboard
Allow to match the error type in toThrow()
I would like to be able to assert the type of an error that is thrown with expect(...).toThrow()
.
For example:
expect(() => rgbColor(255, 255, 999)).toThrow(RangeError);