From b2582f90eba1f8879b0d681f2b0f3cd2736d0274 Mon Sep 17 00:00:00 2001 From: Philip Peitsch Date: Wed, 16 Jan 2019 09:52:43 +1100 Subject: [PATCH] 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. --- lib/resources/content/webpack.config.template.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/resources/content/webpack.config.template.js b/lib/resources/content/webpack.config.template.js index b331c6600..381076e71 100644 --- a/lib/resources/content/webpack.config.template.js +++ b/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