11var webpack = require ( 'webpack' )
2+ var path = require ( 'path' )
23
34module . exports = function ( config ) {
45 // Browsers to run on BrowserStack
@@ -59,7 +60,7 @@ module.exports = function (config) {
5960
6061 browsers : [ 'Chrome' ] ,
6162 frameworks : [ 'mocha' ] ,
62- reporters : [ 'mocha' ] ,
63+ reporters : [ 'mocha' , 'coverage' ] ,
6364
6465 files : [
6566 'tests.webpack.js'
@@ -73,7 +74,8 @@ module.exports = function (config) {
7374 devtool : 'inline-source-map' ,
7475 module : {
7576 loaders : [
76- { test : / \. j s $ / , exclude : / n o d e _ m o d u l e s / , loader : 'babel' }
77+ { test : / \. j s $ / , exclude : / n o d e _ m o d u l e s / , loader : 'babel' } ,
78+ { test : / \. j s $ / , exclude : / _ _ t e s t s _ _ / , include : path . resolve ( 'modules/' ) , loader : 'isparta' }
7779 ]
7880 } ,
7981 plugins : [
@@ -85,12 +87,19 @@ module.exports = function (config) {
8587
8688 webpackServer : {
8789 noInfo : true
90+ } ,
91+
92+ coverageReporter : {
93+ reporters : [
94+ { type : 'html' , subdir : 'html' } ,
95+ { type : 'lcovonly' , subdir : '.' }
96+ ]
8897 }
8998 } )
9099
91100 if ( process . env . USE_CLOUD ) {
92101 config . browsers = Object . keys ( customLaunchers )
93- config . reporters = [ 'dots' ]
102+ config . reporters = [ 'dots' , 'coverage' ]
94103 config . browserDisconnectTimeout = 10000
95104 config . browserDisconnectTolerance = 3
96105 config . browserNoActivityTimeout = 30000
0 commit comments