-
-
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
Improved the jest reporter with snapshot info per test. #3660
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3660 +/- ##
==========================================
+ Coverage 55.85% 56.02% +0.17%
==========================================
Files 189 190 +1
Lines 6383 6406 +23
Branches 6 6
==========================================
+ Hits 3565 3589 +24
+ Misses 2815 2814 -1
Partials 3 3
Continue to review full report at Codecov.
|
The update to the TestResult is nice, then editors can run updates for specific tests too 👍 |
Any updates on the status of this PR? |
I'd like to merge this for 21, sorry for not getting to it earlier. @excitement-engineer do you mind rebasing this change? Also, can we move it below console logs and failures, to the bottom of the result per test? :) |
Hey @cpojer, no problem! I refactored the code a bit to make it cleaner and I wrote some tests for the functionality I added. I also moved it below the console logs and failures:) Let me know what you think! |
a88e95d
to
509474e
Compare
88cde66
to
6e33741
Compare
I rebased the changes! |
Lovely. Thanks for the PR! :) |
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. |
Improved the jest terminal reporter to show snapshot info per test. The snapshot summary shown at the end of the test run shows some generic info like "2 snapshots written in 1 test suite", "1 obsolete snapshot file found". However, it wasn't always immediately clear in what test suite these snapshot changes had occurred. This PR attempts to resolve this by showing all the snapshot changes per test file so that it is immediately clear what happened after a test run. I am curious to hear what you think!
This addresses issue #3581.
I was also thinking that it would be nice if the name of the snapshot which has been updated is shown in the terminal rather than simply stating "2 snapshots written" or "2 obsolete snapshots found". Adding the name to the output does not seem very trivial; the type
TestResult
used in the jest-cli reporter doesn't export the names of the snapshots, it only exports the properties shown below. Therefore, adding the updated snapshot names would entail changing the structure in which the reporter gets its data. What do you guys think, is it worth adding the snapshot names to the output?Let me know what you think!