-
Notifications
You must be signed in to change notification settings - Fork 29
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
Better output from to have properties
#317
Comments
Hi Morten, cool to get an issue from you :-) The assertion you are suggesting have a different semantics than I would like the output to state the keys I'm missing when the assertion fails for both expect({a:1, b:2}, 'to have properties', ['a', 'b', 'c']) output:
|
Hep! I'm not arguing for a new assertion here; I'm merely using it illustrate that the error message of I mostly implemented it as a diff as I could see multiple errors in one pass;
Should ideally give
(Also, hadn't noticed |
Yes exactly, but maybe a bit more compact:
|
This gets rather pointless when the tested object has more than a few dozen properties. And it doesn't tell you if it considers the required properties as strict set equality or a subset.
To get around this, I've re-purposed the code from #255 (comment) to this bastard-thing:
(Yes, I know the assertion isn't the same, but it illustrates the difference in output quite well.)
The text was updated successfully, but these errors were encountered: