@@ -12,7 +12,8 @@ module.exports = (config) => {
12
12
require ( 'karma-sauce-launcher' ) ,
13
13
require ( 'karma-chrome-launcher' ) ,
14
14
require ( 'karma-firefox-launcher' ) ,
15
- require ( 'karma-sourcemap-loader' )
15
+ require ( 'karma-sourcemap-loader' ) ,
16
+ require ( 'karma-coverage' )
16
17
] ,
17
18
files : [
18
19
{ pattern : 'dist/vendor/core-js/client/core.js' , included : true , watched : false } ,
@@ -50,16 +51,23 @@ module.exports = (config) => {
50
51
51
52
customLaunchers : customLaunchers ,
52
53
53
- exclude : [ ] ,
54
54
preprocessors : {
55
- '**/*.js' : [ 'sourcemap' ]
55
+ 'dist/@angular/material/ **/*.js' : [ 'sourcemap' ]
56
56
} ,
57
+
57
58
reporters : [ 'dots' ] ,
59
+
58
60
port : 9876 ,
59
61
colors : true ,
60
62
logLevel : config . LOG_INFO ,
61
63
autoWatch : false ,
62
64
65
+ coverageReporter : {
66
+ type : 'json-summary' ,
67
+ dir : 'dist/coverage/' ,
68
+ subdir : '.'
69
+ } ,
70
+
63
71
sauceLabs : {
64
72
testName : 'material2' ,
65
73
startConnect : false ,
@@ -92,6 +100,11 @@ module.exports = (config) => {
92
100
if ( process . env [ 'TRAVIS' ] ) {
93
101
let buildId = `TRAVIS #${ process . env . TRAVIS_BUILD_NUMBER } (${ process . env . TRAVIS_BUILD_ID } )` ;
94
102
103
+ if ( process . env [ 'TRAVIS_PULL_REQUEST' ] === 'false' ) {
104
+ config . preprocessors [ 'dist/@angular/material/**/!(*+(.|-)spec).js' ] = [ 'coverage' ] ;
105
+ config . reporters . push ( 'coverage' ) ;
106
+ }
107
+
95
108
// The MODE variable is the indicator of what row in the test matrix we're running.
96
109
// It will look like <platform>_<alias>, where platform is one of 'saucelabs' or 'browserstack',
97
110
// and alias is one of the keys in the CI configuration variable declared in
0 commit comments