From 91a8ce893632df4b1ffb9753d312a793754391f0 Mon Sep 17 00:00:00 2001 From: AlexKVal Date: Sat, 20 Jun 2015 22:30:45 +0300 Subject: [PATCH] Fix coverage reporting only for src --- webpack/test-coverage.config.js | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/webpack/test-coverage.config.js b/webpack/test-coverage.config.js index 967ece5dfd..ec4bcf5b08 100644 --- a/webpack/test-coverage.config.js +++ b/webpack/test-coverage.config.js @@ -1,12 +1,31 @@ import _ from 'lodash'; +import path from 'path'; import { jsLoader } from './base.config'; import testConfig from './test.config'; +const paths = { + SRC: path.resolve('src'), + TEST: path.resolve('test'), + TOOLS: path.resolve('tools') // for tools/public-components.js +}; + export default _.extend({}, testConfig, { module: { loaders: [ - { test: /\.js/, loader: `${jsLoader}!isparta`, exclude: /node_modules|test[\/\\]/ }, - { test: /\.js/, loader: jsLoader, include: /test[\/\\]/ } + { + test: /\.js/, + include: [paths.SRC, paths.TEST, paths.TOOLS], + loader: jsLoader, + exclude: /node_modules/ + } + ], + preLoaders: [ + { + test: /\.js/, + loader: 'isparta', + include: paths.SRC, + exclude: /node_modules/ + } ] } });