-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Match object recursively (toMatchObject) #2506
Comments
@ismay How do these examples adapted from the unit tests for describe('toMatchObject', () => {
it('matches recursively', () => {
expect({
a: 'b',
t: {
x: {
r: 'r'
},
z: 'z'
}
}).toMatchObject({
t: {
x: {
r: 'r'
}
}
});
expect({
a: 'b',
t: {
x: {
r: 'r'
},
z: 'z'
}
}).not.toMatchObject({
t: {
l: {
r: 'r'
}
}
});
});
}); |
Maybe I should have worded it differently, but what I mean is it matching:
In the test you mentioned, even though that's nested under |
@ismay are you willing to ship a PR on that? |
Definitely willing, but no time atm I'm afraid. |
Cool, take your time, no worries! 🙂 |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
The discussion on recursive matching suggested here #1793 (comment) was never continued in the PR. As far as I can tell
toMatchObject
does not match recursively, but it would be nice if this was a possibility.The text was updated successfully, but these errors were encountered: