fix(matcher-utils): correct diff for expect asymmetric matchers by davidnormo · Pull Request #12264 · jestjs/jest (original) (raw)

Conversation

@davidnormo

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

SimenB

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

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

Biki-das

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

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

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

@SimenB

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

@davidnormo

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

@Biki-das

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

Thanks for resolving.

@davidnormo

@davidnormo

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

🤦‍♂️ I wasn't building locally

@SimenB

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

🤦‍♂️ I wasn't building locally

Haha, that happens 👍

SimenB

Choose a reason for hiding this comment

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

thanks!

@davidnormo

thanks!

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

@SimenB

chentsulin added a commit to chentsulin/jest that referenced this pull request

Feb 2, 2022

@chentsulin

SimenB pushed a commit that referenced this pull request

Feb 2, 2022

@chentsulin

This was referenced

Feb 7, 2022

@github-actions

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

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

Labels