-
-
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
Verbose test results #370
Verbose test results #370
Conversation
Creates an object that keeps track of an individual test's ancestry. This is done in order to maintain the correct relationship between `describe` blocks and their child `it` blocks.
Prepare a logger to correctly format a verbose response. Traverse test heirarchy to preserve ancestry titles when logging test titles.
Use an instance of `VerboseLogger` to log detailed information about tests when a user adds `--verbose` as a flag.
On each test run, add any failure messages to aggregatedResults, and suppress the default Pass/Fail messages On test run completion, print to the console any error messages that have accrued in aggregatedResults
The verbose output is accomplished using recursion to construct and traverse a tree. This is a simple way of keeping track of a given test title's (it block) ancestry and level of indentation. Both necessary for correct formatting.
This looks really good. We can probably change recursion (in building and reporting the tree) with a loop for a better performance, although, if it's not noticeable performance win, we can keep recursion since it's cleaner. For the visual output, you may want consider instead of coloring the whole title as green, to use just a green checkmark (or red cross in case of failure) -- you can check how Mocha framework displays it. |
Change test result display to a check or x on pass/fail, with a gray colored test title If no highlight is present replace check and x with PASS and FAIL
Move formatMsg to the utils file and make it available for export. Modify the _formatMsg functions found in the DefaultTestReporter, JasmineReporter, and VerboseLogger to use the formatMsg mixin
Thanks for the feedback @DmitrySoshnikov ! Went through and linted all the files, moved the |
OK, this looks perfect, thanks for the contribution! (worth also measuring the time with verbose and standard outputs for analysis) |
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. |
Add a
--verbose
config flag to pretty print the test suite individuallyRelates to issue #4 and takes into account some of the suggestions from pull #92
contributors include myself @PhilVargas and @arcin
called using
jest --verbose
example of when the test suite passes:
example of when the test suite fails: