You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The @vitest/coverage-v8 and @vitest/coverage-c8 packages are expected to provide identical coverage and test results. But that doesn't happen.
Package @vitest/coverage-v8 does not work correctly in terms of coverage for sure. Package @vitest/coverage-c8 is more accurate - sees all uncovered and skipped areas in Vue templates, takes into account missing test files and overall coverage.
Other things being equal settings, package @vitest/coverage-v8 simply always passes the tests and never outputs missing lines or coverage problems.
The @vitest/coverage-v8 (and also @vitest/coverage-istanbul) do not see files outside this root. When I remove the root and change the setupFiles to include that previous root value, the coverage is 100% identical as with @vitest/coverage-c8.
The reason why this happens on c8 is that it does not pass cwd option to test-exclude. This is something that they should do as we've earlier seen that it can cause other issues (#1902 (comment)). For example nyc does this out of the box.
That is, the current behavior of v8 is correct and there is no error? If so, then I'll just fix my config under the root directory of the project.
Or will it still make some changes so that you can specify the source directory?
Describe the bug
The
@vitest/coverage-v8
and@vitest/coverage-c8
packages are expected to provide identical coverage and test results. But that doesn't happen.Package
@vitest/coverage-v8
does not work correctly in terms of coverage for sure. Package@vitest/coverage-c8
is more accurate - sees all uncovered and skipped areas in Vue templates, takes into account missing test files and overall coverage.Other things being equal settings, package
@vitest/coverage-v8
simply always passes the tests and never outputs missing lines or coverage problems.Reproduction
A simplified example is in the repository.
Install dependencies:
yarn
Running tests:
yarn unit
We see a report:
We go into the config and change the coverage provider from v8 to c8. Run the tests again and see the following report:
Conclusion: at the moment v8 does not show coverage in principle
System Info
Used Package Manager
yarn
Validations
The text was updated successfully, but these errors were encountered: