@@ -37,7 +37,7 @@ describe("client authentication", function () {
37
37
it ( "allows auth to be provided with 'auth' method" , function ( done ) {
38
38
if ( helper . redisProcess ( ) . spawnFailed ( ) ) this . skip ( ) ;
39
39
40
- client = redis . createClient . apply ( redis . createClient , args ) ;
40
+ client = redis . createClient . apply ( null , args ) ;
41
41
client . auth ( auth , function ( err , res ) {
42
42
assert . strictEqual ( null , err ) ;
43
43
assert . strictEqual ( "OK" , res . toString ( ) ) ;
@@ -48,7 +48,7 @@ describe("client authentication", function () {
48
48
it ( "emits error when auth is bad without callback" , function ( done ) {
49
49
if ( helper . redisProcess ( ) . spawnFailed ( ) ) this . skip ( ) ;
50
50
51
- client = redis . createClient . apply ( redis . createClient , args ) ;
51
+ client = redis . createClient . apply ( null , args ) ;
52
52
53
53
client . once ( 'error' , function ( err ) {
54
54
assert . strictEqual ( err . command , 'AUTH' ) ;
@@ -62,7 +62,7 @@ describe("client authentication", function () {
62
62
it ( "returns an error when auth is bad (empty string) with a callback" , function ( done ) {
63
63
if ( helper . redisProcess ( ) . spawnFailed ( ) ) this . skip ( ) ;
64
64
65
- client = redis . createClient . apply ( redis . createClient , args ) ;
65
+ client = redis . createClient . apply ( null , args ) ;
66
66
67
67
client . auth ( '' , function ( err , res ) {
68
68
assert . strictEqual ( err . command , 'AUTH' ) ;
@@ -114,7 +114,7 @@ describe("client authentication", function () {
114
114
var args = config . configureClient ( parser , ip , {
115
115
auth_pass : auth
116
116
} ) ;
117
- client = redis . createClient . apply ( redis . createClient , args ) ;
117
+ client = redis . createClient . apply ( null , args ) ;
118
118
client . on ( "ready" , function ( ) {
119
119
return done ( ) ;
120
120
} ) ;
@@ -127,7 +127,7 @@ describe("client authentication", function () {
127
127
password : auth ,
128
128
no_ready_check : true
129
129
} ) ;
130
- client = redis . createClient . apply ( redis . createClient , args ) ;
130
+ client = redis . createClient . apply ( null , args ) ;
131
131
client . on ( "ready" , function ( ) {
132
132
done ( ) ;
133
133
} ) ;
@@ -137,7 +137,7 @@ describe("client authentication", function () {
137
137
if ( helper . redisProcess ( ) . spawnFailed ( ) ) this . skip ( ) ;
138
138
139
139
var args = config . configureClient ( parser , ip ) ;
140
- client = redis . createClient . apply ( redis . createClient , args ) ;
140
+ client = redis . createClient . apply ( null , args ) ;
141
141
client . auth ( auth ) ;
142
142
client . on ( "ready" , function ( ) {
143
143
return done ( ) ;
@@ -148,7 +148,7 @@ describe("client authentication", function () {
148
148
if ( helper . redisProcess ( ) . spawnFailed ( ) ) this . skip ( ) ;
149
149
150
150
var readyCount = 0 ;
151
- client = redis . createClient . apply ( redis . createClient , args ) ;
151
+ client = redis . createClient . apply ( null , args ) ;
152
152
client . auth ( auth ) ;
153
153
client . on ( "ready" , function ( ) {
154
154
readyCount ++ ;
@@ -163,7 +163,7 @@ describe("client authentication", function () {
163
163
it ( 'should return an error if the password is not of type string and a callback has been provided' , function ( done ) {
164
164
if ( helper . redisProcess ( ) . spawnFailed ( ) ) this . skip ( ) ;
165
165
166
- client = redis . createClient . apply ( redis . createClient , args ) ;
166
+ client = redis . createClient . apply ( null , args ) ;
167
167
var async = true ;
168
168
client . auth ( undefined , function ( err , res ) {
169
169
assert . strictEqual ( err . message , 'ERR invalid password' ) ;
@@ -178,7 +178,7 @@ describe("client authentication", function () {
178
178
it ( 'should emit an error if the password is not of type string and no callback has been provided' , function ( done ) {
179
179
if ( helper . redisProcess ( ) . spawnFailed ( ) ) this . skip ( ) ;
180
180
181
- client = redis . createClient . apply ( redis . createClient , args ) ;
181
+ client = redis . createClient . apply ( null , args ) ;
182
182
client . on ( 'error' , function ( err ) {
183
183
assert . strictEqual ( err . message , 'ERR invalid password' ) ;
184
184
assert . strictEqual ( err . command , 'AUTH' ) ;
@@ -193,7 +193,7 @@ describe("client authentication", function () {
193
193
var args = config . configureClient ( parser , ip , {
194
194
auth_pass : auth
195
195
} ) ;
196
- client = redis . createClient . apply ( redis . createClient , args ) ;
196
+ client = redis . createClient . apply ( null , args ) ;
197
197
client . on ( "ready" , function ( ) {
198
198
client . auth ( auth , helper . isString ( 'OK' , done ) ) ;
199
199
} ) ;
@@ -205,7 +205,7 @@ describe("client authentication", function () {
205
205
var args = config . configureClient ( parser , ip , {
206
206
no_ready_check : true
207
207
} ) ;
208
- client = redis . createClient . apply ( redis . createClient , args ) ;
208
+ client = redis . createClient . apply ( null , args ) ;
209
209
client . on ( "ready" , function ( ) {
210
210
client . set ( 'foo' , 'bar' , function ( err , res ) {
211
211
assert . equal ( err . message , 'NOAUTH Authentication required.' ) ;
@@ -218,7 +218,7 @@ describe("client authentication", function () {
218
218
219
219
it ( 'does not allow auth to be provided post-hoc with auth method if not authenticated before' , function ( done ) {
220
220
if ( helper . redisProcess ( ) . spawnFailed ( ) ) this . skip ( ) ;
221
- client = redis . createClient . apply ( redis . createClient , args ) ;
221
+ client = redis . createClient . apply ( null , args ) ;
222
222
client . on ( "error" , function ( err ) {
223
223
assert . equal ( err . code , 'NOAUTH' ) ;
224
224
assert . equal ( err . message , 'Ready check failed: NOAUTH Authentication required.' ) ;
0 commit comments