1
1
var webpack = require ( 'webpack' )
2
+ var path = require ( 'path' )
2
3
3
4
module . exports = function ( config ) {
4
5
// Browsers to run on BrowserStack
@@ -59,7 +60,7 @@ module.exports = function (config) {
59
60
60
61
browsers : [ 'Chrome' ] ,
61
62
frameworks : [ 'mocha' ] ,
62
- reporters : [ 'mocha' ] ,
63
+ reporters : [ 'mocha' , 'coverage' ] ,
63
64
64
65
files : [
65
66
'tests.webpack.js'
@@ -73,7 +74,8 @@ module.exports = function (config) {
73
74
devtool : 'inline-source-map' ,
74
75
module : {
75
76
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' }
77
79
]
78
80
} ,
79
81
plugins : [
@@ -85,12 +87,19 @@ module.exports = function (config) {
85
87
86
88
webpackServer : {
87
89
noInfo : true
90
+ } ,
91
+
92
+ coverageReporter : {
93
+ reporters : [
94
+ { type : 'html' , subdir : 'html' } ,
95
+ { type : 'lcovonly' , subdir : '.' }
96
+ ]
88
97
}
89
98
} )
90
99
91
100
if ( process . env . USE_CLOUD ) {
92
101
config . browsers = Object . keys ( customLaunchers )
93
- config . reporters = [ 'dots' ]
102
+ config . reporters = [ 'dots' , 'coverage' ]
94
103
config . browserDisconnectTimeout = 10000
95
104
config . browserDisconnectTolerance = 3
96
105
config . browserNoActivityTimeout = 30000
0 commit comments