@@ -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
/**
52
53
* 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(){
154
155
. pipe ( install ( ) ) ;
155
156
} ) ;
156
157
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 ) {
159
160
if ( err ) {
160
161
var exitCode = 2 ;
161
162
console . log ( '[FAIL] test task failed - exiting with code ' + exitCode ) ;
@@ -256,6 +257,29 @@ gulp.task('run-stress-tests', function () {
256
257
} ) ) . on ( 'end' , logActiveNodeHandles ) ;
257
258
} ) ;
258
259
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
+
259
283
function logActiveNodeHandles ( ) {
260
284
if ( enableActiveNodeHandlesLogging ) {
261
285
console . log ( '-- Active NodeJS handles START\n' , process . _getActiveHandles ( ) , '\n-- Active NodeJS handles END' ) ;
0 commit comments