V8 Coverage: Exclude empty lines, comments, TS types #5423
Labels
feat: coverage
Issues and PRs related to the coverage feature
p3-significant
High priority enhancement (priority)
Clear and concise description of the problem
There's now a PR for improved v8 coverage remapping in
v8-to-istanbul
:There are some coverage reports in the linked PR that show what kind of changes it would cause.
tsc
does though)/* v8 ignore ... */
) exclude the lines instead of marking them as covered. Exactly asistanbul-lib-instrument
does.Related issues:
Suggested solution
Typically PRs in
istanbuljs
organization take long time to land so we could apply the changes aspnpm patch
and bundlev8-to-istanbul
into@vitest/coverage-v8
package.At first we might want to introduce this as opt-in coverage option and enable it by default in V2. The changes that this introduces can affect line coverage in such ways that projects using
coverage.thresholds
may now fail in CI - exactly as they should do. Line coverage is now more accurate as comments don't increase it.Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: