File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ import { provider } from 'std-env'
19
19
20
20
import c from 'tinyrainbow'
21
21
import { BaseCoverageProvider } from 'vitest/coverage'
22
- import { parseAstAsync } from 'vitest/node'
22
+ import { isCSSRequest , parseAstAsync } from 'vitest/node'
23
23
import { version } from '../package.json' with { type : 'json' }
24
24
25
25
export interface ScriptCoverageWithOffset extends Profiler . ScriptCoverage {
@@ -397,7 +397,14 @@ export class V8CoverageProvider extends BaseCoverageProvider<ResolvedCoverageOpt
397
397
}
398
398
}
399
399
400
- if ( this . isIncluded ( fileURLToPath ( result . url ) ) ) {
400
+ if (
401
+ this . isIncluded ( fileURLToPath ( result . url ) )
402
+
403
+ // Ignore CSS requests, e.g. in Vue.
404
+ // File extension itself is .vue, but it contains CSS.
405
+ // e.g. "Example.vue?vue&type=style&index=0&scoped=f7f04e08&lang.css"
406
+ && ! isCSSRequest ( result . url )
407
+ ) {
401
408
scriptCoverages . push ( result )
402
409
}
403
410
}
You can’t perform that action at this time.
0 commit comments