rejects.toThrow()
only works when an instance of Error is thrown
#9748
Labels
rejects.toThrow()
only works when an instance of Error is thrown
#9748
🐛 Bug Report
Currently the
.rejects.toThrow()
assertion only works when the argument is an instance ofnew Error()
. It does not work when it's a string or a plain object.To Reproduce
Expected behavior
Test cases 1 and 2 should pass. I know this may very well be a feature and not a bug and in that case I'd like to open the discussion in changing the behaviour of
.toThrow()
to pass on the first two cases. I think the results are rather inconsistent.The text was updated successfully, but these errors were encountered: