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
Differentiate coverage report scope between watch and run mode #2628
Comments
This sounds like a valid use case and should be supported without requiring users to modify the configuration file between So when
I think user should see all files, including uncovered ones, in watch mode when
So currently when Internally Vitest already keeps track whether tests are running for the first time so we could quite easily flip the @xsjcTony does the use case descriptions above sound good?
That change only modified default value of |
@AriPerkkio Yes, that describes exactly what I want. Thanks so much for making it clearer🎉! |
@AriPerkkio Thanks soooooooooo much for the PR. it saves my life. I actually have another simple question but it's not really important. Generally, which of c8 and Istanbul is better in terms of performance (report generation speed)? |
It depends. There can be cases where c8 is faster but I can imagine cases where istanbul could be faster. They work so much differently that it's difficult to say which one could be considered faster. It's not just about the coverage collection speed, but also the result post-processing. For example, V8 coverage will reporter coverage of all the run functions, including all your Personally I don't consider speed as the factor when choosing between the two. The istanbul provider is much more precise since instrumentation is AST based. The c8 doesn't do any AST analysis, and cannot differentiate code comments from code that actually runs. There's good summary of the differences here: jestjs/jest#11188. Try both and pick your favourite. |
Clear and concise description of the problem
Based on the issue #2316 and the fix #2385 , I cannot find a way to achieve:
include
option even if there's no test file for it (needsall: true
)But currently, using
istanbul
orc8
(I've tried both), I cannot achieve this.If I set
all: true
, then I can get the full coverage inrun mode
, but inwatch mode
I will get the full report as well, no matter what's the value ofcleanOnRerun
option.If I set
all: false
, then inwatch mode
I can see only those files are covered, but I CANNOT get all files inrun mode
.Is there any way I can get different coverage scope between those two mode?
Suggested solution
Like the comment in #2385 (comment) , create another option for that. (for
watch mode
only,run mode
will refer to the value ofall
option)Additional context
And also I want to double-check, is that new feature in #2385 only for
istanbul
? Since I personally prefer usingc8
(but like I said, I've tried both but none of them are working)Validations
The text was updated successfully, but these errors were encountered: