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
Support asymmetric matching in toMatchObject
#2787
Conversation
Hm, that doesn't look good - but the CI failure seems to be related to a possibly-intermittent yarn problem. Can the job for the failing Node version be rerun? |
@@ -679,6 +679,8 @@ describe('toMatchObject()', () => { | |||
[{a: 'b', t: {x: {r: 'r'}, z: 'z'}}, {t: {x: {r: 'r'}}}], | |||
[{a: [3, 4, 5], b: 'b'}, {a: [3, 4, 5]}], | |||
[{a: [3, 4, 5, 'v'], b: 'b'}, {a: [3, 4, 5, 'v']}], | |||
[{a: 1, c: 2}, {a: jestExpect.any(Number)}], | |||
[{a: {x: 'x', y: 'y'}}, {a: {x: jestExpect.any(String)}}], |
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.
yes, tests!
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.
well I do use Jest for a reason ;)
This looks good, thanks for the PR! |
Nice work! |
Well shucks…it was only four lines of copy-pasted code and @thymikee told me exactly how to do it but I am loving this positive feedback! |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Closes #2781.
This adds support for “asymmetric matching” to
toMatchObject
. Example:Now passes.