File tree 2 files changed +8
-8
lines changed
2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 31
31
},
32
32
"homepage" : " https://github.com/fiznool/passport-oauth2-refresh" ,
33
33
"devDependencies" : {
34
- "chai" : " ^3. 4.1" ,
35
- "mocha" : " ^2.3.4 " ,
36
- "sinon" : " ^1.17.2 " ,
37
- "sinon-chai" : " ^2.8 .0"
34
+ "chai" : " ^4.1.2 " ,
35
+ "mocha" : " ^5.2.0 " ,
36
+ "sinon" : " ^5.1.0 " ,
37
+ "sinon-chai" : " ^3.1 .0"
38
38
},
39
39
"engines" : {
40
40
"node" : " >=0.10.0"
Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ describe('Auth token refresh', function() {
121
121
122
122
expect ( fn ) . to . throw ( Error , 'Cannot register: not an OAuth2 strategy' ) ;
123
123
} ) ;
124
-
124
+
125
125
it ( 'should use the default getOAuthAccessToken function if not overwritten by strategy' , function ( ) {
126
126
var strategy = {
127
127
name : 'test_strategy' ,
@@ -137,7 +137,7 @@ describe('Auth token refresh', function() {
137
137
name : 'test_strategy' ,
138
138
_oauth2 : newOAuth2 ( )
139
139
} ;
140
-
140
+
141
141
strategy . _oauth2 . getOAuthAccessToken = new Function ( ) ;
142
142
143
143
AuthTokenRefresh . use ( strategy ) ;
@@ -199,11 +199,11 @@ describe('Auth token refresh', function() {
199
199
200
200
it ( 'should not refresh if the strategy was not previously registered' , function ( ) {
201
201
var done = sinon . spy ( ) ;
202
- var expectedErr = new Error ( ' Strategy was not registered to refresh a token') ;
202
+ var expected = sinon . match . instanceOf ( Error ) . and ( sinon . match . has ( 'message' , ' Strategy was not registered to refresh a token') ) ;
203
203
204
204
AuthTokenRefresh . requestNewAccessToken ( 'test_strategy' , 'refresh_token' , done ) ;
205
205
206
- expect ( done ) . to . have . been . calledWith ( expectedErr ) ;
206
+ expect ( done ) . to . have . been . calledWith ( expected ) ;
207
207
} ) ;
208
208
} ) ;
209
209
} ) ;
You can’t perform that action at this time.
0 commit comments