File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 3131 },
3232 "homepage" : " https://github.com/fiznool/passport-oauth2-refresh" ,
3333 "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"
3838 },
3939 "engines" : {
4040 "node" : " >=0.10.0"
Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ describe('Auth token refresh', function() {
121121
122122 expect ( fn ) . to . throw ( Error , 'Cannot register: not an OAuth2 strategy' ) ;
123123 } ) ;
124-
124+
125125 it ( 'should use the default getOAuthAccessToken function if not overwritten by strategy' , function ( ) {
126126 var strategy = {
127127 name : 'test_strategy' ,
@@ -137,7 +137,7 @@ describe('Auth token refresh', function() {
137137 name : 'test_strategy' ,
138138 _oauth2 : newOAuth2 ( )
139139 } ;
140-
140+
141141 strategy . _oauth2 . getOAuthAccessToken = new Function ( ) ;
142142
143143 AuthTokenRefresh . use ( strategy ) ;
@@ -199,11 +199,11 @@ describe('Auth token refresh', function() {
199199
200200 it ( 'should not refresh if the strategy was not previously registered' , function ( ) {
201201 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') ) ;
203203
204204 AuthTokenRefresh . requestNewAccessToken ( 'test_strategy' , 'refresh_token' , done ) ;
205205
206- expect ( done ) . to . have . been . calledWith ( expectedErr ) ;
206+ expect ( done ) . to . have . been . calledWith ( expected ) ;
207207 } ) ;
208208 } ) ;
209209} ) ;
You can’t perform that action at this time.
0 commit comments