File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -401,10 +401,22 @@ describe('connection tests', function () {
401
401
connect_timeout : 1000
402
402
} ) ;
403
403
process . nextTick ( function ( ) {
404
- assert . strictEqual ( client . stream . timeout , 1000 ) ;
404
+ // node > 4
405
+ var timeout = client . stream . timeout ;
406
+ // node <= 4
407
+ if ( timeout === undefined ) timeout = client . stream . _idleTimeout ;
408
+ assert . strictEqual ( timeout , 1000 ) ;
405
409
} ) ;
406
410
client . on ( 'connect' , function ( ) {
407
- assert . strictEqual ( client . stream . timeout , 0 ) ;
411
+ // node > 4
412
+ var expected = 0 ;
413
+ var timeout = client . stream . timeout ;
414
+ // node <= 4
415
+ if ( timeout === undefined ) {
416
+ timeout = client . stream . _idleTimeout ;
417
+ expected = - 1 ;
418
+ }
419
+ assert . strictEqual ( timeout , expected ) ;
408
420
assert . strictEqual ( client . stream . listeners ( 'timeout' ) . length , 0 ) ;
409
421
client . on ( 'ready' , done ) ;
410
422
} ) ;
You can’t perform that action at this time.
0 commit comments