-
-
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
Issue7105 #7540
Issue7105 #7540
Conversation
@joanasmramos Thank you for making a pull request to fix the issue. We agree there is room to improve the report when an assertion fails in Jest. A goal for changes is let people quickly see information that is relevant to them. An early step is some matchers like Because the labels and values are aligned like two columns in a table, I prefer not to extend the first label from A next step (which we have been slow to achieve) is to replace the deleted words with visual contrast: matcher name as regular black instead of dim gray in the line at the beginning of the report: expect(received).toBeGreaterThan(expected)
expect(received).toBeLessThan(expected Improved assertion line will also display any To put it another way, goal is people can choose to focus on the values, or the assertion, or both. Because there are hundreds of updated snapshots to review, we need to change format of matcher name in small batches of a few related matchers (like these two matchers) in each pull request. We would be happy for you to take a share in this effort:
When we have merged the prerequisite improvement, I can add a comment to this pull request:
If we (especially the we who is me :) can get our act together sooner than later, it would be an honor if Jest can merge your first pull requests on a public project. If developer experience and information design interest you, there are also other rough edges in Jest that deserve attention in 2019. P.S. one source that has helped me most is Non Designer’s Design Book by Robin Williams |
Thanks @joanasmramos for tackling that! There's ongoing effort from @pedrottimark to improve the expect output with #7557 adding bold matcher names for readability. Let's close this and focus on mentioned PR. |
@joanasmramos Thank you for your patience. #7557 has been merged which will help you open a new pull request. The goal is to “divide and conquer” visually so readers can focus on either or both of the following:
Please look at two of the Changed Files in the recently merged PR as an example: Adapting the changes to
Adapting changes to
Because change to exported name After you make the changes and verify that the changes in failing snapshots are correct, you can update them with command |
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. |
Summary
This branch is aiming to fix issue #7105 providing clearer fail messages for toBeGreaterThan and toBeLessThan
Test plan
I made two test cases for a function that returns the sum of its two arguments. The first test case verifies if 5+5 is greater than 10. This was the output before:
And now:
The second test verifies if 5+5 is less than 10. This was the output before:
And now: