Generating coverage report for Jenkins
Change-Id: Iafff523061f7f9bfa3fb8cdacd491ec7380309f3
diff --git a/conf/karma.conf.js b/conf/karma.conf.js
index 2db6132..066b292 100644
--- a/conf/karma.conf.js
+++ b/conf/karma.conf.js
@@ -34,8 +34,13 @@
},
reporters: ['progress', 'coverage'],
coverageReporter: {
- type: 'html',
- dir: 'coverage/'
+ // type: 'html',
+ dir: 'coverage/',
+ reporters: [
+ {type: 'json', subdir: '.'},
+ {type: 'html', subdir: 'html'},
+ {type: 'cobertura', subdir: '.'}
+ ]
},
webpack: require('./webpack-test.conf'),
webpackMiddleware: {
diff --git a/conf/webpack-test.conf.js b/conf/webpack-test.conf.js
index a87e383..4720649 100644
--- a/conf/webpack-test.conf.js
+++ b/conf/webpack-test.conf.js
@@ -43,11 +43,18 @@
test: /\.(png|woff|woff2|eot|ttf|svg|jpg|gif|jpeg)$/,
loader: 'url-loader?limit=100000'
}
+ ],
+ postLoaders : [
+ {
+ test: /\.ts$/,
+ exclude: /(node_modules|tests|(.spec\.ts))/,
+ loader: 'istanbul-instrumenter' // used to to get the code coverage for TypeScript
+ }
]
},
plugins: [],
debug: true,
- devtool: 'source-map',
+ devtool: false,
resolve: {
extensions: [
'',
@@ -58,7 +65,7 @@
]
},
ts: {
- configFileName: 'tsconfig.json'
+ configFileName: 'tsconfig.test.json'
},
tslint: {
configuration: require('../tslint.json')