diff --git a/karma.conf.js b/karma.conf.js index e60364e3..6a2b5a9c 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -15,7 +15,7 @@ module.exports = function(config) { // list of files / patterns to load in the browser files: [ - 'webpack.tests.js' + 'test/specs/**/*.spec.js' ], @@ -28,17 +28,27 @@ module.exports = function(config) { // preprocess matching files before serving them to the browser // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor preprocessors: { - 'webpack.tests.js': ['webpack', 'sourcemap', 'coverage'] + 'test/specs/**/*.spec.js': ['webpack', 'sourcemap'] }, webpack: { + cache: true, + devtool: 'inline-source-map', + module: { + postLoaders: [ + { + test: /\.js$/, + exclude: /(node_modules|test)/, + loader: 'istanbul-instrumenter' + } + ] + }, externals: [ { './adapters/http': 'var undefined' } - ], - devtool: 'inline-source-map' + ] }, webpackServer: { diff --git a/package.json b/package.json index 9ef8de4c..d7c81322 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "grunt-ts": "5.0.0-beta.5", "grunt-update-json": "0.2.1", "grunt-webpack": "1.0.11", + "istanbul-instrumenter-loader": "^0.1.3", "jasmine-core": "2.3.4", "karma": "0.13.10", "karma-coverage": "0.5.2", diff --git a/webpack.tests.js b/webpack.tests.js deleted file mode 100644 index ed890d02..00000000 --- a/webpack.tests.js +++ /dev/null @@ -1,2 +0,0 @@ -var context = require.context('./test/specs', true, /\.js$/); -context.keys().forEach(context);