-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Describe the bug
Hello,
I am experiencing an issue with the coverage report in Vitest when using Browser Mode with a web component built with Lit. When I run the tests and try to view the coverage, the page is blank. It seems that the coverage report is looking for the folder at the root of the project, not taking into account the reportsDirectory setting in my vite.config.js file.
reportsDirectory:./test/coverage/,
==
I would like to suggest an improvement for the LCOV reporter. Currently, the LCOV reporter generates the same files as the HTML reporter. However, I believe the LCOV reporter could be improved by creating a separate folder for its output. This would keep everything more organized, instead of leaving all the files in the root of the /coverage folder. Furthermore, when the Vitest UI is activated, the LCOV reporter is "equated" to the HTML reporter for generating the report view.
Reproduction
You can reproduce this issue by downloading the repository from my GitHub or viewing it on Stackblitz.
https://github.com/oscarmarina/lit-vitest-testing-comparison
https://stackblitz.com/github/oscarmarina/lit-vitest-testing-comparison
npm i && npm run testSystem Info
System:
OS: macOS 12.7.2
CPU: (4) x64 Intel(R) Core(TM) i5-5287U CPU @ 2.90GHz
Memory: 17.82 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 20.10.0 - ~/.nvm/versions/node/v20.10.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v20.10.0/bin/yarn
npm: 10.3.0 - ~/.nvm/versions/node/v20.10.0/bin/npm
pnpm: 8.6.5 - ~/.nvm/versions/node/v20.10.0/bin/pnpm
Browsers:
Chrome Canary: 122.0.6257.0
Safari: 17.2.1Used Package Manager
npm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.