@@ -5,7 +5,7 @@ const Config = require("../src/Config");
5
5
var loginWithWrongCredentialsShouldFail = function ( username , password ) {
6
6
return new Promise ( ( resolve , reject ) => {
7
7
Parse . User . logIn ( username , password )
8
- . then ( user => reject ( 'login should have failed' ) )
8
+ . then ( ( ) => reject ( 'login should have failed' ) )
9
9
. catch ( err => {
10
10
if ( err . message === 'Invalid username/password.' ) {
11
11
resolve ( ) ;
@@ -20,7 +20,7 @@ var isAccountLockoutError = function(username, password, duration, waitTime) {
20
20
return new Promise ( ( resolve , reject ) => {
21
21
setTimeout ( ( ) => {
22
22
Parse . User . logIn ( username , password )
23
- . then ( user => reject ( 'login should have failed' ) )
23
+ . then ( ( ) => reject ( 'login should have failed' ) )
24
24
. catch ( err => {
25
25
if ( err . message === 'Your account is locked due to multiple failed login attempts. Please try again after ' + duration + ' minute(s)' ) {
26
26
resolve ( ) ;
@@ -45,7 +45,7 @@ describe("Account Lockout Policy: ", () => {
45
45
user . setPassword ( 'password' ) ;
46
46
return user . signUp ( null ) ;
47
47
} )
48
- . then ( user => {
48
+ . then ( ( ) => {
49
49
return loginWithWrongCredentialsShouldFail ( 'username1' , 'incorrect password 1' ) ;
50
50
} )
51
51
. then ( ( ) => {
@@ -71,7 +71,7 @@ describe("Account Lockout Policy: ", () => {
71
71
publicServerURL : "https://my.public.server.com/1"
72
72
} )
73
73
. then ( ( ) => {
74
- var config = new Config ( 'test' ) ;
74
+ new Config ( 'test' ) ;
75
75
fail ( 'set duration to an invalid number test failed' ) ;
76
76
done ( ) ;
77
77
} )
@@ -95,7 +95,7 @@ describe("Account Lockout Policy: ", () => {
95
95
publicServerURL : "https://my.public.server.com/1"
96
96
} )
97
97
. then ( ( ) => {
98
- var config = new Config ( 'test' ) ;
98
+ new Config ( 'test' ) ;
99
99
fail ( 'set threshold to an invalid number test failed' ) ;
100
100
done ( ) ;
101
101
} )
@@ -119,7 +119,7 @@ describe("Account Lockout Policy: ", () => {
119
119
publicServerURL : "https://my.public.server.com/1"
120
120
} )
121
121
. then ( ( ) => {
122
- var config = new Config ( 'test' ) ;
122
+ new Config ( 'test' ) ;
123
123
fail ( 'threshold value < 1 is invalid test failed' ) ;
124
124
done ( ) ;
125
125
} )
@@ -143,7 +143,7 @@ describe("Account Lockout Policy: ", () => {
143
143
publicServerURL : "https://my.public.server.com/1"
144
144
} )
145
145
. then ( ( ) => {
146
- var config = new Config ( 'test' ) ;
146
+ new Config ( 'test' ) ;
147
147
fail ( 'threshold value > 999 is invalid test failed' ) ;
148
148
done ( ) ;
149
149
} )
@@ -167,7 +167,7 @@ describe("Account Lockout Policy: ", () => {
167
167
publicServerURL : "https://my.public.server.com/1"
168
168
} )
169
169
. then ( ( ) => {
170
- var config = new Config ( 'test' ) ;
170
+ new Config ( 'test' ) ;
171
171
fail ( 'duration value < 1 is invalid test failed' ) ;
172
172
done ( ) ;
173
173
} )
@@ -191,7 +191,7 @@ describe("Account Lockout Policy: ", () => {
191
191
publicServerURL : "https://my.public.server.com/1"
192
192
} )
193
193
. then ( ( ) => {
194
- var config = new Config ( 'test' ) ;
194
+ new Config ( 'test' ) ;
195
195
fail ( 'duration value > 99999 is invalid test failed' ) ;
196
196
done ( ) ;
197
197
} )
@@ -230,7 +230,7 @@ describe("Account Lockout Policy: ", () => {
230
230
return isAccountLockoutError ( 'username2' , 'wrong password' , 1 , 1 ) ;
231
231
} )
232
232
. then ( ( ) => {
233
- done ( ) ;
233
+ done ( ) ;
234
234
} )
235
235
. catch ( err => {
236
236
fail ( 'lock account after failed login attempts test failed: ' + JSON . stringify ( err ) ) ;
@@ -301,7 +301,7 @@ describe("Account Lockout Policy: ", () => {
301
301
return new Promise ( ( resolve , reject ) => {
302
302
setTimeout ( ( ) => {
303
303
Parse . User . logIn ( 'username4' , 'correct password' )
304
- . then ( user => resolve ( ) )
304
+ . then ( ( ) => resolve ( ) )
305
305
. catch ( err => reject ( err ) ) ;
306
306
} , 3001 ) ;
307
307
} ) ;
0 commit comments