Skip to content

Commit

Permalink
fix(webpack): correctly exclude spec/test files from coverage report
Browse files Browse the repository at this point in the history
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 16, 2019
1 parent c6fc624 commit b2582f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/resources/content/webpack.config.template.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b2582f9

Please sign in to comment.