- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 225
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
Implement toIncludeAllPartialMembers
#210
Implement toIncludeAllPartialMembers
#210
Conversation
Codecov Report
@@ Coverage Diff @@
## main #210 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 123 125 +2
Lines 761 774 +13
Branches 111 115 +4
=========================================
+ Hits 761 774 +13
Continue to review full report at Codecov.
|
Bump, curious if anyone’s had the chance to look into this yet? 🙂 |
I would like this. |
e3b21e5
to
3a046a9
Compare
Bumping this as well. Any concerns with adding and releasing this? (Besides the request to throw in a |
Bump, this is a useful new piece for jest-extended and I'm sad to see the pull request is waiting for almost 2 years now! |
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.
thanks!
toIncludeAllPartialMembers
toIncludeAllPartialMembers
What
Implement
toIncludeAllPartialMembers
matcher.Why
Consider the following test:
I would like to assert that the provided array's objects partially contain all properties of the provided members. Currently,
toIncludeAllMembers
is the closest available matcher but it's too strict on matching the exact shape of each member.What I need is the matcher to ignore additional properties and only partially match against the provided members.
Notes
toIncludeAllMembers
to accept an options object (e.g.{ isPartial: true }
) that would configure the matcher to either partially or fully test for equality.toIncludeAnyPartialMembers
would be another potentially useful matcher, but I wanted to keep this PR small and focused.Housekeeping
yarn contributor
)