@@ -47,6 +47,7 @@ var os = require('os');
4747var file = require ( 'gulp-file' ) ;
4848var semver = require ( 'semver' ) ;
4949var sharedNeo4j = require ( './test/internal/shared-neo4j' ) . default ;
50+ var ts = require ( 'gulp-typescript' ) ;
5051
5152/**
5253 * Useful to investigate resource leaks in tests. Enable to see active sockets and file handles after the 'test' task.
@@ -154,8 +155,8 @@ gulp.task('install-driver-into-sandbox', ['nodejs'], function(){
154155 . pipe ( install ( ) ) ;
155156} ) ;
156157
157- gulp . task ( 'test' , function ( cb ) {
158- runSequence ( 'test-nodejs' , 'test-browser' , 'run-tck' , function ( err ) {
158+ gulp . task ( 'test' , function ( cb ) {
159+ runSequence ( 'run-ts-declaration-tests' , ' test-nodejs', 'test-browser' , 'run-tck' , function ( err ) {
159160 if ( err ) {
160161 var exitCode = 2 ;
161162 console . log ( '[FAIL] test task failed - exiting with code ' + exitCode ) ;
@@ -256,6 +257,29 @@ gulp.task('run-stress-tests', function () {
256257 } ) ) . on ( 'end' , logActiveNodeHandles ) ;
257258} ) ;
258259
260+ gulp . task ( 'run-ts-declaration-tests' , function ( ) {
261+ var failed = false ;
262+
263+ return gulp . src ( [ 'test/types/**/*' , 'types/**/*' ] , { base : '.' } )
264+ . pipe ( ts ( {
265+ module : 'es6' ,
266+ target : 'es6' ,
267+ noImplicitAny : true ,
268+ noImplicitReturns : true ,
269+ strictNullChecks : true ,
270+ } ) )
271+ . on ( 'error' , function ( ) {
272+ failed = true ;
273+ } )
274+ . on ( 'finish' , function ( ) {
275+ if ( failed ) {
276+ console . log ( '[ERROR] TypeScript declarations contain errors. Exiting...' ) ;
277+ process . exit ( 1 ) ;
278+ }
279+ } )
280+ . pipe ( gulp . dest ( 'build/test/types' ) ) ;
281+ } ) ;
282+
259283function logActiveNodeHandles ( ) {
260284 if ( enableActiveNodeHandlesLogging ) {
261285 console . log ( '-- Active NodeJS handles START\n' , process . _getActiveHandles ( ) , '\n-- Active NodeJS handles END' ) ;
0 commit comments