Skip to content

Commit

Permalink
chore(karma.conf): include istanbul coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickJS committed Dec 21, 2015
1 parent 17c4f9f commit e069c87
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @AngularClass
var path = require('path');

module.exports = function(config) {
var _config = {
Expand Down Expand Up @@ -61,6 +62,15 @@ module.exports = function(config) {
{ test: /\.json$/, loader: 'json-loader' },
{ test: /\.html$/, loader: 'raw-loader' },
{ test: /\.css$/, loader: 'raw-loader' }
],
postLoaders: [
// instrument only testing sources with Istanbul
{
test: /\.(js|ts)$/,
include: path.resolve('src'),
loader: 'istanbul-instrumenter-loader',
exclude: [ /\.e2e\.ts$/, /node_modules/ ]
}
]
},
stats: { colors: true, reasons: true },
Expand All @@ -72,6 +82,14 @@ module.exports = function(config) {
]
},

coverageReporter: {
dir : 'coverage/',
reporters: [
{ type: 'text-summary' },
{ type: 'html' }
],
},

webpackServer: {
noInfo: true //please don't spam the console when running in karma!
},
Expand All @@ -80,7 +98,7 @@ module.exports = function(config) {
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress'],
reporters: [ 'progress', 'coverage' ],


// web server port
Expand Down Expand Up @@ -109,5 +127,7 @@ module.exports = function(config) {
// if true, Karma captures browsers, runs the tests and exits
singleRun: true
};

config.set(_config);

};

0 comments on commit e069c87

Please sign in to comment.