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
6161 }
6262
6363 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 ) ) ) {
6572 return
6673 }
6774
@@ -199,7 +206,7 @@ export class IstanbulCoverageProvider extends BaseCoverageProvider<ResolvedCover
199206 }
200207
201208 // 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 } ` )
203210 const lastCoverage = this . instrumenter . lastFileCoverage ( )
204211 coverageMap . addFileCoverage ( lastCoverage )
205212
You can’t perform that action at this time.
0 commit comments