File tree Expand file tree Collapse file tree 2 files changed +22
-14
lines changed
Expand file tree Collapse file tree 2 files changed +22
-14
lines changed Original file line number Diff line number Diff line change @@ -14,5 +14,6 @@ module.exports = {
1414 lib : directory . lib ,
1515 test : directory . test ,
1616 target : directory . target ,
17- dist : directory . dist
17+ dist : directory . dist ,
18+ ceverageMin : 98
1819} ;
Original file line number Diff line number Diff line change @@ -42,25 +42,32 @@ module.exports = {
4242 process . chdir ( target ) ;
4343 var testSrc = prependToAll ( '..' , config . testSources ) ;
4444 var src = prependToAll ( '..' , config . sources ) ;
45- return gulp . src ( testSrc , { read : false } )
45+ var stream = gulp . src ( testSrc , { read : false } )
4646 . pipe ( cover . instrument ( {
4747 pattern : src ,
4848 debugDirectory : 'debug'
4949 } ) )
5050 . pipe ( mocha ( ) )
51- . pipe ( cover . gather ( ) )
52- . pipe ( cover . enforce ( {
53- statements : 98 ,
54- blocks : 98 ,
55- lines : 98 ,
51+ . pipe ( cover . gather ( ) ) ;
52+
53+ if ( process . env . TRAVIS == 'true' ) {
54+ stream = stream . pipe ( cover . format ( [
55+ { reporter : 'lcov' }
56+ ] ) )
57+ . pipe ( coveralls ( ) ) ;
58+ } else {
59+ stream = stream . pipe ( cover . format ( [
60+ { reporter : 'html' } ,
61+ { reporter : 'json' } ,
62+ { reporter : 'lcov' }
63+ ] ) )
64+ . pipe ( gulp . dest ( 'reports' ) ) ;
65+ }
66+ return stream . pipe ( cover . enforce ( {
67+ statements : config . ceverageMin ,
68+ blocks : config . ceverageMin ,
69+ lines : config . ceverageMin ,
5670 } ) )
57- . pipe ( cover . format ( [
58- { reporter : 'html' , outFile : 'coverage.html' } ,
59- { reporter : 'json' , outFile : 'coverage.json' } ,
60- { reporter : 'lcov' , outFile : 'coverage.lcov' } ,
61- ] ) )
62- . pipe ( coveralls ( ) )
63- . pipe ( gulp . dest ( 'reports' ) )
6471 . on ( 'end' , function ( ) {
6572 process . chdir ( pwd ) ;
6673 } ) ;
You can’t perform that action at this time.
0 commit comments