You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: .toEqual won't perform a deep equality check for two errors. Only the message property of an Error is considered for equality. It is recommended to use the .toThrow matcher for testing against errors.
We should be able to use the typescript-powered type checking to determine if an expect value is an instance of Error, and if so check if the matcher being used is .toThrow.
The text was updated successfully, but these errors were encountered:
G-Rath
changed the title
recommend toThrow matcher for testing against errors (via typechecking)
[new-rule] recommend toThrow matcher for testing against errors (via typechecking)
Mar 27, 2021
The documentation for
toEqual
says this:We should be able to use the typescript-powered type checking to determine if an
expect
value is an instance ofError
, and if so check if the matcher being used is.toThrow
.The text was updated successfully, but these errors were encountered: