-
Notifications
You must be signed in to change notification settings - Fork 1
Add SummaryReporter for vitest #76
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
Conversation
I tested these changes via yalc and seems to be working properly. |
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.
Can you add a comment with an example of the output using the DefaultReporter versus this new reporter for a repository where we've enabled Vitest? Also I had a query about how the changes here relate to the BasicReporter.
@@ -0,0 +1,11 @@ | |||
import { DefaultReporter } from 'vitest/reporters'; |
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 see that Vitest also has a BasicReporter
. How does the output from that differ from what we're doing here?
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.
The basic reporter is the same as the default reporter, but with the summary disabled. Basically the opposite of what we want.
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.
Sorry, my bad. The basic reporter seems to be the same we want, except that it does not print the progress in real time, only at the end.
basic-reporter-2025-04-24_10.54.48.mp4
That makes me think that the summary is not what I have been calling "summary", but the output from every file. Perhaps we should find a better name for our reporter?
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.
By the discussion here, it seems what we want is in fact the summary, so SummaryReporter
sounds like a good name vitest-dev/vitest#7881
A comment where? |
85b51f1
to
c955e22
Compare
c955e22
to
a0fcdc9
Compare
This PR adds a
SummaryReporter
for projects using vitest, which extends the default reporter but suppressing the output generated at the end of every file.That output was a bit annoying for us, since we pre-bundle a single test file, causing a big chunk of output to be printed at the very end of the test execution.
Since not all projects are using vitest yet, this PR also defines vitest as an optional peer dependency, and exposes vitest-related symbols from a new
@hypothesis/frontend-testing/vitest
entry point.