@@ -115,9 +115,7 @@ describe("client authentication", function () {
115115 auth_pass : auth
116116 } ) ;
117117 client = redis . createClient . apply ( null , args ) ;
118- client . on ( "ready" , function ( ) {
119- return done ( ) ;
120- } ) ;
118+ client . on ( "ready" , done ) ;
121119 } ) ;
122120
123121 it ( 'allows auth and no_ready_check to be provided as config option for client' , function ( done ) {
@@ -128,9 +126,7 @@ describe("client authentication", function () {
128126 no_ready_check : true
129127 } ) ;
130128 client = redis . createClient . apply ( null , args ) ;
131- client . on ( "ready" , function ( ) {
132- done ( ) ;
133- } ) ;
129+ client . on ( "ready" , done ) ;
134130 } ) ;
135131
136132 it ( 'allows auth to be provided post-hoc with auth method' , function ( done ) {
@@ -139,25 +135,24 @@ describe("client authentication", function () {
139135 var args = config . configureClient ( parser , ip ) ;
140136 client = redis . createClient . apply ( null , args ) ;
141137 client . auth ( auth ) ;
142- client . on ( "ready" , function ( ) {
143- return done ( ) ;
144- } ) ;
138+ client . on ( "ready" , done ) ;
145139 } ) ;
146140
147141 it ( 'reconnects with appropriate authentication' , function ( done ) {
148142 if ( helper . redisProcess ( ) . spawnFailed ( ) ) this . skip ( ) ;
149143
150- var readyCount = 0 ;
151144 client = redis . createClient . apply ( null , args ) ;
152145 client . auth ( auth ) ;
153146 client . on ( "ready" , function ( ) {
154- readyCount ++ ;
155- if ( readyCount === 1 ) {
147+ if ( this . times_connected === 1 ) {
156148 client . stream . destroy ( ) ;
157149 } else {
158- return done ( ) ;
150+ done ( ) ;
159151 }
160152 } ) ;
153+ client . on ( 'reconnecting' , function ( params ) {
154+ assert . strictEqual ( params . error . message , 'Stream connection closed' ) ;
155+ } ) ;
161156 } ) ;
162157
163158 it ( 'should return an error if the password is not of type string and a callback has been provided' , function ( done ) {
0 commit comments