@@ -11,18 +11,20 @@ var ts = require('gulp-typescript');
11
11
var typescript = require ( 'typescript' ) ;
12
12
var tslint = require ( 'gulp-tslint' ) ;
13
13
14
- gulp . task ( 'test.check-format' , function ( ) {
14
+ function checkFormat ( ) {
15
15
return gulp . src ( [ '*.js' , 'lib/**/*.ts' , 'test/**/*.ts' ] )
16
16
. pipe ( formatter . checkFormat ( 'file' , clangFormat ) )
17
17
. on ( 'warning' , onError ) ;
18
- } ) ;
18
+ }
19
+ exports [ 'test.check-format' ] = checkFormat ;
19
20
20
- gulp . task ( 'test.check-lint' , function ( ) {
21
+ function checkLint ( ) {
21
22
return gulp . src ( [ 'lib/**/*.ts' , 'test/**/*.ts' ] )
22
23
. pipe ( tslint ( { formatter : 'verbose' } ) )
23
24
. pipe ( tslint . report ( ) )
24
25
. on ( 'warning' , onError ) ;
25
- } ) ;
26
+ }
27
+ exports [ 'test.check-lint' ] = checkLint ;
26
28
27
29
var hasError ;
28
30
var failOnError = true ;
@@ -65,7 +67,7 @@ gulp.task('test.compile', gulp.series('compile', function(done) {
65
67
. pipe ( gulp . dest ( 'build/' ) ) ; // '/test/' comes from base above.
66
68
} ) ) ;
67
69
68
- gulp . task ( 'test.unit' , gulp . series ( 'test.compile' , function ( done ) {
70
+ unitTests = gulp . series ( 'test.compile' , function ( done ) {
69
71
if ( hasError ) {
70
72
done ( ) ;
71
73
return ;
@@ -74,11 +76,12 @@ gulp.task('test.unit', gulp.series('test.compile', function(done) {
74
76
timeout : 4000 , // Needed by the type-based tests :-(
75
77
fullTrace : true ,
76
78
} ) ) ;
77
- } ) ) ;
79
+ } ) ;
80
+ exports [ 'test.unit' ] = unitTests ;
78
81
79
- gulp . task ( 'test' , gulp . series ( 'test.check-format' , 'test.check-lint' , 'test.unit' ) ) ;
82
+ gulp . task ( 'test' , gulp . series ( checkFormat , checkLint , unitTests ) ) ;
80
83
81
- gulp . task ( 'watch' , gulp . series ( 'test.unit' , function ( ) {
84
+ gulp . task ( 'watch' , gulp . series ( unitTests , function ( ) {
82
85
failOnError = false ;
83
86
// Avoid watching generated .d.ts in the build (aka output) directory.
84
87
return gulp . watch ( [ 'lib/**/*.ts' , 'test/**/*.ts' ] , { ignoreInitial : true } , [ 'test.unit' ] ) ;
0 commit comments