Skip to content
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

fix(matcher-utils): correct diff for expect asymmetric matchers #12264

Merged
merged 1 commit into from
Jan 31, 2022

Conversation

davidnormo
Copy link
Contributor

@davidnormo davidnormo commented Jan 21, 2022

Summary

Fixes #10276 - I've applied @SamLee's suggestion

Problem:

// Where objectContaining is the wrapping the expectation the diff would not work as expected
expect(obj).toEqual(expect.objectContaining(obj2));

Test plan

Before

Screen Shot 2022-01-21 at 11 04 38

After

Screen Shot 2022-01-21 at 11 09 31

) {
return false;
}

if (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems odd to me to remove the check for expectedType, but not receivedType? Although I guess passing an asymmetric matcher as received is weird, so maybe not

@davidnormo
Copy link
Contributor Author

There appears to be a couple of failing tests on main not coming from this change

Copy link
Contributor

@Biki-das Biki-das left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI is not happy , i think this is due to this change

@davidnormo
Copy link
Contributor Author

CI is not happy , i think this is due to this change

The same failures are on main, unrelated to my change afaik

@SimenB
Copy link
Member

SimenB commented Jan 28, 2022

All tests are failing, that's not happening on main 😀

@davidnormo
Copy link
Contributor Author

I've rebased from main and I get these failing tests on my branch and main locally:

  • e2e/tests/watchModePatterns.test.ts
  • e2e/tests/customInlineSnapshotMatchers.test.ts
    All others passing...

@Biki-das
Copy link
Contributor

I've rebased from main and I get these failing tests on my branch and main locally:

  • e2e/tests/watchModePatterns.test.ts
  • e2e/tests/customInlineSnapshotMatchers.test.ts
    All others passing...

Thanks for resolving.

@davidnormo
Copy link
Contributor Author

All tests are failing, that's not happening on main 😀

🤦‍♂️ I wasn't building locally

@SimenB
Copy link
Member

SimenB commented Jan 31, 2022

All tests are failing, that's not happening on main 😀

🤦‍♂️ I wasn't building locally

Haha, that happens 👍

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@SimenB SimenB merged commit 9edcaaf into jestjs:main Jan 31, 2022
@davidnormo
Copy link
Contributor Author

thanks!

Ah it looks like my CHANGELOG change got clobbered. Shall I open a separate PR for it?

@SimenB
Copy link
Member

SimenB commented Jan 31, 2022

yes please!

@github-actions
Copy link

github-actions bot commented Mar 3, 2022

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nested objectContaining does not show diff
4 participants