File tree Expand file tree Collapse file tree 3 files changed +79
-2
lines changed Expand file tree Collapse file tree 3 files changed +79
-2
lines changed Original file line number Diff line number Diff line change
1
+ // Type definitions for gulp-istanbul v0.8.1
2
+ // Project: https://github.com/SBoudrias/gulp-istanbul
3
+ // Definitions by: Asana <https://asana.com>
4
+ // Definitions: https://github.com/borisyankov/DefinitelyTyped
5
+
6
+ /// <reference path="../node/node.d.ts"/>
7
+
8
+ declare module "gulp-istanbul" {
9
+ function GulpIstanbul ( opts ?: GulpIstanbul . Options ) : NodeJS . ReadWriteStream ;
10
+
11
+ module GulpIstanbul {
12
+ export function hookRequire ( ) : NodeJS . ReadWriteStream ;
13
+ export function summarizeCoverage ( opts ?: { coverageVariable ?: string } ) : Coverage ;
14
+ export function writeReports ( opts ?: ReportOptions ) : NodeJS . ReadWriteStream ;
15
+
16
+ interface Options {
17
+ coverageVariable ?: string ;
18
+ includeUntested ?: boolean ;
19
+ embedSource ?: boolean ;
20
+ preserveComments ?: boolean ;
21
+ noCompact ?: boolean ;
22
+ noAutoWrap ?: boolean ;
23
+ codeGenerationOptions ?: Object ;
24
+ debug ?: boolean ;
25
+ walkDebug ?: boolean ;
26
+ }
27
+
28
+ interface Coverage {
29
+ lines : CoverageStats ;
30
+ statements : CoverageStats ;
31
+ functions : CoverageStats ;
32
+ branches : CoverageStats ;
33
+ }
34
+
35
+ interface CoverageStats {
36
+ total : number ;
37
+ covered : number ;
38
+ skipped : number ;
39
+ pct : number ;
40
+ }
41
+
42
+ interface ReportOptions {
43
+ dir ?: string ;
44
+ reporters ?: string [ ] ;
45
+ reportOpts ?: { dir ?: string } ;
46
+ coverageVariable ?: string ;
47
+ }
48
+ }
49
+
50
+ export = GulpIstanbul ;
51
+ }
Original file line number Diff line number Diff line change @@ -29,4 +29,17 @@ gulp.task('test', function (cb) {
29
29
. pipe ( istanbul . writeReports ( { reporters : [ 'text' ] } ) ) // Creating the reports after tests runned
30
30
. on ( 'end' , cb ) ;
31
31
} ) ;
32
+ } ) ;
33
+
34
+ gulp . task ( 'test' , function ( cb ) {
35
+ gulp . src ( [ 'lib/**/*.js' , 'main.js' ] )
36
+ . pipe ( istanbul ( { includeUntested : true } ) ) // Covering files
37
+ . pipe ( istanbul . hookRequire ( ) )
38
+ . on ( 'finish' , function ( ) {
39
+ gulp . src ( [ 'test/*.html' ] )
40
+ . pipe ( testFramework ( ) )
41
+ . pipe ( istanbul . writeReports ( { reporters : [ 'text' ] } ) ) // Creating the reports after tests runned
42
+ . pipe ( istanbul . enforceThresholds ( { thresholds : { global : 90 } } ) ) //
43
+ . on ( 'end' , cb ) ;
44
+ } ) ;
32
45
} ) ;
Original file line number Diff line number Diff line change 1
- // Type definitions for gulp-istanbul
1
+ // Type definitions for gulp-istanbul v0.9.0
2
2
// Project: https://github.com/SBoudrias/gulp-istanbul
3
3
// Definitions by: Asana <https://asana.com>
4
4
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -12,6 +12,7 @@ declare module "gulp-istanbul" {
12
12
export function hookRequire ( ) : NodeJS . ReadWriteStream ;
13
13
export function summarizeCoverage ( opts ?: { coverageVariable ?: string } ) : Coverage ;
14
14
export function writeReports ( opts ?: ReportOptions ) : NodeJS . ReadWriteStream ;
15
+ export function enforceThresholds ( opts ?: ThresholdOptions ) : NodeJS . ReadWriteStream ;
15
16
16
17
interface Options {
17
18
coverageVariable ?: string ;
@@ -45,7 +46,19 @@ declare module "gulp-istanbul" {
45
46
reportOpts ?: { dir ?: string } ;
46
47
coverageVariable ?: string ;
47
48
}
49
+
50
+ interface ThresholdOptions {
51
+ coverageVariable ?: string ;
52
+ thresholds ?: { global ?: Coverage | number ; each ?: Coverage | number } ;
53
+ }
54
+
55
+ interface CoverageOptions {
56
+ lines ?: number ;
57
+ statements ?: number ;
58
+ functions ?: number ;
59
+ branches ?: number ;
60
+ }
48
61
}
49
62
50
63
export = GulpIstanbul ;
51
- }
64
+ }
You can’t perform that action at this time.
0 commit comments