-
-
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
Don't highlight passing asymmetric matchers as changes in diffs #7027
Comments
I like this suggestion! @pedrottimark think it's possible? |
@calebeby Thank you for the example. Yes, I agree the output is unclear. It’s a challenge to fix :) We need to break down barriers of lost information between steps evaluate, serialize, and diff. If you are interested to lend a hand, here are current thoughts what we might need to do:
|
@rickhanlonii can we reuse something here from snapshot property matchers? Or vice versa |
Is this a dupe of #6184? |
I believe so |
Cool, thanks, will close in favor of that since it's older 👌 |
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. |
🚀 Feature Proposal
Hi 👋. I think it would be great if Jest would better highlight diffs for objects with asymmetric matchers. Currently, Jest highlights correct/passing asymmetric matchers as changes, which is confusing to the user. I propose that Jest only highlights the matchers that do not pass.
For example:
This output is unclear to the user. It shows that the
name
property is different from the expected value, which makes it less clear that theweek
property is missing. Objects with more properties make it harder and harder to tell the actual changes.I propose that Jest highlights the above example like:
This would make it much more clear to the user which property is missing.
The text was updated successfully, but these errors were encountered: