@@ -32,7 +32,7 @@ const oauthClient = new OAuthClientTest({
32
32
clientSecret : 'clientSecret' ,
33
33
environment : 'sandbox' ,
34
34
redirectUri : 'http://localhost:8000/callback' ,
35
- logging : false ,
35
+ logging : true ,
36
36
} ) ;
37
37
38
38
const { expect } = chai ;
@@ -241,7 +241,7 @@ describe('Tests for OAuthClient', () => {
241
241
242
242
it ( 'Get User Info in Sandbox' , ( ) =>
243
243
oauthClient . getUserInfo ( ) . then ( ( authResponse ) => {
244
- expect ( JSON . stringify ( authResponse . getJson ( ) ) ) . to . be . equal (
244
+ expect ( JSON . stringify ( authResponse . json ) ) . to . be . equal (
245
245
JSON . stringify ( expectedUserInfo ) ,
246
246
) ;
247
247
} ) ) ;
@@ -266,7 +266,7 @@ describe('Tests for OAuthClient', () => {
266
266
it ( 'Get User Info in Production' , ( ) => {
267
267
oauthClient . environment = 'production' ;
268
268
return oauthClient . getUserInfo ( ) . then ( ( authResponse ) => {
269
- expect ( JSON . stringify ( authResponse . getJson ( ) ) ) . to . be . equal (
269
+ expect ( JSON . stringify ( authResponse . json ) ) . to . be . equal (
270
270
JSON . stringify ( expectedUserInfo ) ,
271
271
) ;
272
272
} ) ;
@@ -301,7 +301,7 @@ describe('Tests for OAuthClient', () => {
301
301
'12345' ,
302
302
} )
303
303
. then ( ( authResponse ) => {
304
- expect ( JSON . stringify ( authResponse . getJson ( ) ) ) . to . be . equal (
304
+ expect ( JSON . stringify ( authResponse . json ) ) . to . be . equal (
305
305
JSON . stringify ( expectedMakeAPICall ) ,
306
306
) ;
307
307
} ) ;
@@ -317,12 +317,12 @@ describe('Tests for OAuthClient', () => {
317
317
} ,
318
318
} )
319
319
. then ( ( authResponse ) => {
320
- expect ( JSON . stringify ( authResponse . getJson ( ) ) ) . to . be . equal (
320
+ expect ( JSON . stringify ( authResponse . json ) ) . to . be . equal (
321
321
JSON . stringify ( expectedMakeAPICall ) ,
322
322
) ;
323
323
} ) ;
324
324
} ) ;
325
- it ( 'loadResponseFromJWKsURI' , ( ) => {
325
+ xit ( 'loadResponseFromJWKsURI' , ( ) => {
326
326
const request = {
327
327
url : 'https://sandbox-quickbooks.api.intuit.com/v3/company/12345/companyinfo/12345' ,
328
328
} ;
@@ -357,7 +357,7 @@ describe('Tests for OAuthClient', () => {
357
357
'https://quickbooks.api.intuit.com/v3/company/' + '12345' + '/companyinfo/' + '12345' ,
358
358
} )
359
359
. then ( ( authResponse ) => {
360
- expect ( JSON . stringify ( authResponse . getJson ( ) ) ) . to . be . equal (
360
+ expect ( JSON . stringify ( authResponse . json ) ) . to . be . equal (
361
361
JSON . stringify ( expectedMakeAPICall ) ,
362
362
) ;
363
363
} ) ;
@@ -580,6 +580,7 @@ describe('Test Create Error Wrapper', () => {
580
580
581
581
it ( 'should handle an authResponse' , ( ) => {
582
582
const errorMessage = 'error foo' ;
583
+ authResponse . body = '' ;
583
584
const wrappedE = oauthClient . createError ( new Error ( errorMessage ) , authResponse ) ;
584
585
expect ( wrappedE . error ) . to . be . equal ( authResponse . response . statusText ) ;
585
586
expect ( JSON . stringify ( wrappedE . authResponse ) ) . to . be . equal ( JSON . stringify ( authResponse ) ) ;
0 commit comments