Closed
Description
I have a test that passes, even though I expect it to fail:
{
run () {
throw new SyntaxError();
},
throws: TypeError,
}
I know that both SyntaxError
and TypeError
are subclasses of the Error
class, and according to our docs and the code we have in our codebase, this test should (and does) pass. But should it?
I found a way to get the granularity I need:
{
run () {
throw new SyntaxError();
},
throws: (error) => error.constructor === TypeError;
}
Is this the right/expected way to get what I need?
Metadata
Metadata
Assignees
Labels
No labels