toEqual
reports undefined
when other keys do not match
#7083
Labels
p3-minor-bug
An edge case that only affects very specific usage (priority)
Describe the bug
Consider the following case:
If you are using
toEqual
, since it should not take care aboutundefined
, you should expect the following comparison to fail:Because of the
qux
key, but the error also takes in consideration theundefined
value, according to the following error:Which seems to be inconsistent, because if you remove the
qux
key,toEqual
does not complain about theundefined
.Reproduction
Just use the following test:
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: