File tree 2 files changed +22
-14
lines changed
2 files changed +22
-14
lines changed Original file line number Diff line number Diff line change @@ -14,5 +14,6 @@ module.exports = {
14
14
lib : directory . lib ,
15
15
test : directory . test ,
16
16
target : directory . target ,
17
- dist : directory . dist
17
+ dist : directory . dist ,
18
+ ceverageMin : 98
18
19
} ;
Original file line number Diff line number Diff line change @@ -42,25 +42,32 @@ module.exports = {
42
42
process . chdir ( target ) ;
43
43
var testSrc = prependToAll ( '..' , config . testSources ) ;
44
44
var src = prependToAll ( '..' , config . sources ) ;
45
- return gulp . src ( testSrc , { read : false } )
45
+ var stream = gulp . src ( testSrc , { read : false } )
46
46
. pipe ( cover . instrument ( {
47
47
pattern : src ,
48
48
debugDirectory : 'debug'
49
49
} ) )
50
50
. 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 ,
56
70
} ) )
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' ) )
64
71
. on ( 'end' , function ( ) {
65
72
process . chdir ( pwd ) ;
66
73
} ) ;
You can’t perform that action at this time.
0 commit comments