-
-
Notifications
You must be signed in to change notification settings - Fork 698
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
sameMembers reports members that are actual correct #1146
Comments
Just to be clear: the diff is generated by your test runner (e.g., Mocha), not by Chai. However, Chai provides the I agree that the expected output you provided in your example is more useful than the current output. Chai could achieve this by sorting the expected and actual arrays in the case of unordered Given these current issues & limitations in Chai related to diffing, I'm not sure the value of this change is high enough to justify the cost. |
Hey @LokiMidgard thanks for this issue! We'll be spending a lot of time with the new version of chai to address issues like this. I think right now this issue will likely be swept up with a bunch of new refactoring work on our inspection utilities. I think we can close this as it'll be implicitly resolved by a new major release of |
It's been 6 years, and it looks like the aforementioned work did not end up addressing this. Can this be re-opened? Or should I create a new issue? |
Sure please file a new issue with a concrete reproduction. Thanks! |
I've noticed that
sameMembers
reports members that are included in the expected and actual because they are not on the same position in the array.Sample:
This should and will fail because
e
is not in expected. However the output will hint at every element buta
I would expect an output simular to following, because I didn't used
sameOrderedMembers
:For completness, the assert does not fail if only the order elements is different, but all and not more elements are in the actuall array.
The text was updated successfully, but these errors were encountered: