@@ -47,6 +47,7 @@ var os = require('os');
47
47
var file = require ( 'gulp-file' ) ;
48
48
var semver = require ( 'semver' ) ;
49
49
var sharedNeo4j = require ( './test/internal/shared-neo4j' ) . default ;
50
+ var ts = require ( 'gulp-typescript' ) ;
50
51
51
52
gulp . task ( 'default' , [ "test" ] ) ;
52
53
@@ -149,8 +150,8 @@ gulp.task('install-driver-into-sandbox', ['nodejs'], function(){
149
150
. pipe ( install ( ) ) ;
150
151
} ) ;
151
152
152
- gulp . task ( 'test' , function ( cb ) {
153
- runSequence ( 'test-nodejs' , 'test-browser' , 'run-tck' , function ( err ) {
153
+ gulp . task ( 'test' , function ( cb ) {
154
+ runSequence ( 'run-ts-declaration-tests' , ' test-nodejs', 'test-browser' , 'run-tck' , function ( err ) {
154
155
if ( err ) {
155
156
var exitCode = 2 ;
156
157
console . log ( '[FAIL] test task failed - exiting with code ' + exitCode ) ;
@@ -250,3 +251,26 @@ gulp.task('run-stress-tests', function () {
250
251
verbose : true
251
252
} ) ) ;
252
253
} ) ;
254
+
255
+ gulp . task ( 'run-ts-declaration-tests' , function ( ) {
256
+ var failed = false ;
257
+
258
+ return gulp . src ( [ 'test/types/**/*' , 'types/**/*' ] , { base : '.' } )
259
+ . pipe ( ts ( {
260
+ module : 'es6' ,
261
+ target : 'es6' ,
262
+ noImplicitAny : true ,
263
+ noImplicitReturns : true ,
264
+ strictNullChecks : true ,
265
+ } ) )
266
+ . on ( 'error' , function ( ) {
267
+ failed = true ;
268
+ } )
269
+ . on ( 'finish' , function ( ) {
270
+ if ( failed ) {
271
+ console . log ( '[ERROR] TypeScript declarations contain errors. Exiting...' ) ;
272
+ process . exit ( 1 ) ;
273
+ }
274
+ } )
275
+ . pipe ( gulp . dest ( 'build/test/types' ) ) ;
276
+ } ) ;
0 commit comments