New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why do object->deep.include and array.of.object->deep.include behave differently? #1479
Comments
use caseI have an API with a request object, that is similar to the response object. The response object does contain some additional information including timestamps. I understand for simple cases that include/contains behave differently for arrays and objects. However deep comparing objects containing arrays of objects leads to strange situations. |
summary
I would expect that a deep.include of an array of objects compares the contained objects via deep.include and not via deep.equal.
aka.
expect([{x:1,y:2}]).deep.include([{x:1}])
behaves likeexpect({x:1,y:2}).deep.include({x:1})
version
chai 4.3.6
expected
actual
example code with workaround using lodash
The text was updated successfully, but these errors were encountered: