-
-
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
Print errors after test structure in verbose mode #4438
Print errors after test structure in verbose mode #4438
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
"PASS __tests__/console.test.js | ||
✓ works just fine | ||
" ✓ works just fine | ||
PASS __tests__/console.test.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is the right behavior. We should print the PASS message before any test results.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you look at the snapshot tests, the printing is now incorrect for most cases. The test result header with the test name should come first, then the individual test names and then the errors. Would you mind making those changes? Thanks!
Ok @cpojer , I will working on this right away. But first I would like to get a better understanding of the right behavior: The actual behavior on master is something like this: But If we implement two different ways to print the result, depends on it's PASS or FAIL, the screen will become in something like this: As you can see the "Runtime" sentence of the FAIL test result is printed just next to the previous test result. I think this looks confused so maybe we could go another way. It could be something like print the test result header of the FAIL test the first (just like is now on master branch), and so print the errors at the bottom like you can see in the screenshot posted above, but changing "FAIL" message to another thing like, for example, "ERRORS" Becoming in something like this: What do you think about that implementation @cpojer @aaronabramov ? |
I think the task here is to literally swap the list of tests that were run with the errors. Currently the errors come first and the list second and this change should swap the two, without making any other changes. Thanks! |
Thanks very much @cpojer ! So would it have to become something like this?: |
Exactly! Can you make the minimal changes to the code to make this happen? :) |
Sure! I am working on it right now :) |
dd65839
to
0d5b5ee
Compare
@cpojer , @aaronabramov, this PR continue here #4504 |
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 is a fix for this issue #4264
When running a single test that has many test cases the error messages are printed before the list of failing/passing tests which makes us to scroll up every time just to see the error message.
This Pull Request change the behavior of print error messages to put them after the list of tests
So the behavior is going to switch from the actual:
to this: