-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Copy link
Labels
feat: coverageIssues and PRs related to the coverage featureIssues and PRs related to the coverage featurep3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)
Description
Describe the bug
Trying to run coverage with:
@vitest/[email protected]
@vitest/[email protected]
[email protected]
Will accidentally try to instrument the SASS in an SFC.
This worked fine in @vitest/[email protected]
I suspect this bug was introduced by #7939 and we're running into issues because the transformed id looks like App.vue?vue&type=style&index=0&lang.scss
, but the check is ignoring files that end in .css
(which doesn't match .scss
).
Reproduction
- Clone https://github.com/alecgibson/vitest-coverage-bug
npm i
npm test
- See errors in console about coverage trying to parse SCSS, when I would expect no errors
System Info
System:
OS: macOS 15.5
CPU: (10) arm64 Apple M1 Pro
Memory: 124.19 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.9.0 - ~/.nvm/versions/node/v20.9.0/bin/node
Yarn: 1.22.22 - ~/.yarn/bin/yarn
npm: 10.1.0 - ~/.nvm/versions/node/v20.9.0/bin/npm
pnpm: 10.5.2 - ~/.nvm/versions/node/v20.9.0/bin/pnpm
bun: 1.0.15 - ~/.bun/bin/bun
Browsers:
Chrome: 137.0.7151.70
Safari: 18.5
npmPackages:
@vitejs/plugin-vue: ^5.2.4 => 5.2.4
@vitest/browser: ^3.2.3 => 3.2.3
@vitest/coverage-istanbul: ^3.2.3 => 3.2.3
playwright: ^1.53.0 => 1.53.0
vite: ^6.3.5 => 6.3.5
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.
Serhansolo
Metadata
Metadata
Assignees
Labels
feat: coverageIssues and PRs related to the coverage featureIssues and PRs related to the coverage featurep3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)