Skip to content
Permalink
Browse files

fix(webpack): correctly exclude spec/test files from coverage report

The string {spec,test} is not a valid regex and thus didn't match filenames containing spec or test, as was clearly intended.
This caused coverage reports to include these files.

The new regex now correctly excludes these test files.
  • Loading branch information...
peitschie committed Jan 15, 2019
1 parent c6fc624 commit b2582f90eba1f8879b0d681f2b0f3cd2736d0274
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/resources/content/webpack.config.template.js
@@ -266,7 +266,7 @@ module.exports = ({ production, server, extractCss, coverage, analyze, karma } =
// @if transpiler.id='typescript'
...when(coverage, {
test: /\.[jt]s$/i, loader: 'istanbul-instrumenter-loader',
include: srcDir, exclude: [/\.{spec,test}\.[jt]s$/i],
include: srcDir, exclude: [/\.(spec|test)\.[jt]s$/i],
enforce: 'post', options: { esModules: true },
})
// @endif

0 comments on commit b2582f9

Please sign in to comment.
You can’t perform that action at this time.