File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
packages/coverage-istanbul/src Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,14 @@ export class IstanbulCoverageProvider extends BaseCoverageProvider<ResolvedCover
61
61
}
62
62
63
63
onFileTransform ( sourceCode : string , id : string , pluginCtx : any ) : { code : string ; map : any } | undefined {
64
- if ( ! this . testExclude . shouldInstrument ( id ) ) {
64
+ // Istanbul/babel cannot instrument CSS - e.g. Vue imports end up here.
65
+ // File extension itself is .vue, but it contains CSS.
66
+ // e.g. "Example.vue?vue&type=style&index=0&scoped=f7f04e08&lang.css"
67
+ if ( id . endsWith ( '.css' ) ) {
68
+ return
69
+ }
70
+
71
+ if ( ! this . testExclude . shouldInstrument ( removeQueryParameters ( id ) ) ) {
65
72
return
66
73
}
67
74
@@ -199,7 +206,7 @@ export class IstanbulCoverageProvider extends BaseCoverageProvider<ResolvedCover
199
206
}
200
207
201
208
// Make sure file is not served from cache so that instrumenter loads up requested file coverage
202
- await transform ( `${ filename } ?v =${ cacheKey } ` )
209
+ await transform ( `${ filename } ?cache =${ cacheKey } ` )
203
210
const lastCoverage = this . instrumenter . lastFileCoverage ( )
204
211
coverageMap . addFileCoverage ( lastCoverage )
205
212
You can’t perform that action at this time.
0 commit comments