-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
feat: coverageIssues and PRs related to the coverage featureIssues and PRs related to the coverage feature
Description
Describe the bug
Hi,
I'm using c8 for test coverage in a Vite/Vue project and encountered an issue while testing a .vue file with a <style> tag.
When having a <style> tag with content, coverage report indicate only 1 line, and 100% coverage.
Removing the tag content causes the coverage report to display correct values.
(Running test with istanbul does not raise this issue.)
Result:
Statements : 100% ( 1/1 )
Branches : 100% ( 0/0 )
Functions : 100% ( 0/0 )
Lines : 100% ( 1/1 )
Expected Result:
Statements : 91.66% ( 11/12 )
Branches : 0% ( 0/1 )
Functions : 100% ( 0/0 )
Lines : 91.66% ( 11/12 )
Reproduction
Here is a repository to reproduce : https://github.com/Polluux/demo-c8-issues
(Note : This repository contains multiple issues for c8)
System Info
System:
Ubuntu 22.04.1 LTS x86_64 GNU/Linux
Node:
v16.15.1
Dependencies:
"vue": "^3.2.45"
"@vitejs/plugin-vue": "^4.0.0",
"@vitest/coverage-c8": "^0.26.0",
"@vue/test-utils": "2.2.6",
"c8": "^7.12.0",
"jsdom": "^20.0.3",
"typescript": "^4.9.4",
"vite": "^4.0.2",
"vitest": "^0.26.0",
"vue-tsc": "^1.0.14"Used 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.
smarlhens
Metadata
Metadata
Assignees
Labels
feat: coverageIssues and PRs related to the coverage featureIssues and PRs related to the coverage feature