-
Notifications
You must be signed in to change notification settings - Fork 781
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
assert.propContains API Implementation & Tests #1668
Conversation
Thanks @izelnakri, I support inclusion of a method like this. In terms of semantics, I believe this would be most useful as sibling to propEqual rather than deepEqual. In other words, own properties only (ignore constructor) and non-recursive, which I believe is how you've implemented it as well. I'd propose a slightly different name that incorporates the term "prop" for consistency with |
Yes.
I agree |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I'll probably land/release next weekend. Would you be interested in adding a doc page as well?
I'm going for a holiday tomorrow, but I'll see if I can do it during my trip :) |
Also cross-link with propEqual pages, and improve those as well, in particular to clarify that these too are recursive in regards to nested objects being comparable using plain objects. Ref qunitjs#1668.
Also cross-link with propEqual pages, and improve those as well, in particular to clarify that these too are recursive in regards to nested objects being comparable using plain objects. Ref qunitjs#1668.
@izelnakri I've landed this now to simplify unrelated code changes I'm doing today. I made a few judgement calls that I think will align with your intent, but I'd love to hear from you prior to releasing this, I'm open to changing or reconsidering any aspect of it! Thanks again for the PR. |
I think this is a good addition to the existing QUnit public API. It is rather too common that I need to partially check object values. Also includes
notPropContains
.Example: