@@ -40,7 +40,7 @@ import {
4040 getExpectedExternalAccountMetricsHeaderValue ,
4141} from './externalclienthelper' ;
4242import { DEFAULT_UNIVERSE } from '../src/auth/authclient' ;
43-
43+ import { TestUtils } from './utils' ;
4444nock . disableNetConnect ( ) ;
4545
4646interface SampleResponse {
@@ -965,7 +965,7 @@ describe('BaseExternalAccountClient', () => {
965965 } ) ;
966966
967967 it ( 'should force refresh when cached credential is expired' , async ( ) => {
968- clock = sinon . useFakeTimers ( 0 ) ;
968+ clock = TestUtils . useFakeTimers ( sinon ) ;
969969 const emittedEvents : Credentials [ ] = [ ] ;
970970 const stsSuccessfulResponse2 = Object . assign ( { } , stsSuccessfulResponse ) ;
971971 stsSuccessfulResponse2 . access_token = 'ACCESS_TOKEN2' ;
@@ -1063,7 +1063,8 @@ describe('BaseExternalAccountClient', () => {
10631063 } ) ;
10641064
10651065 it ( 'should respect provided eagerRefreshThresholdMillis' , async ( ) => {
1066- clock = sinon . useFakeTimers ( 0 ) ;
1066+ clock = TestUtils . useFakeTimers ( sinon ) ;
1067+
10671068 const customThresh = 10 * 1000 ;
10681069 const stsSuccessfulResponse2 = Object . assign ( { } , stsSuccessfulResponse ) ;
10691070 stsSuccessfulResponse2 . access_token = 'ACCESS_TOKEN2' ;
@@ -1381,7 +1382,7 @@ describe('BaseExternalAccountClient', () => {
13811382 } ) ;
13821383
13831384 it ( 'should force refresh when cached credential is expired' , async ( ) => {
1384- clock = sinon . useFakeTimers ( 0 ) ;
1385+ clock = TestUtils . useFakeTimers ( sinon ) ;
13851386 const emittedEvents : Credentials [ ] = [ ] ;
13861387 const stsSuccessfulResponse2 = Object . assign ( { } , stsSuccessfulResponse ) ;
13871388 stsSuccessfulResponse2 . access_token = 'ACCESS_TOKEN2' ;
@@ -1505,7 +1506,7 @@ describe('BaseExternalAccountClient', () => {
15051506 } ) ;
15061507
15071508 it ( 'should respect provided eagerRefreshThresholdMillis' , async ( ) => {
1508- clock = sinon . useFakeTimers ( 0 ) ;
1509+ clock = TestUtils . useFakeTimers ( sinon ) ;
15091510 const customThresh = 10 * 1000 ;
15101511 const stsSuccessfulResponse2 = Object . assign ( { } , stsSuccessfulResponse ) ;
15111512 stsSuccessfulResponse2 . access_token = 'ACCESS_TOKEN2' ;
@@ -2540,7 +2541,7 @@ describe('BaseExternalAccountClient', () => {
25402541
25412542 describe ( 'setCredentials()' , ( ) => {
25422543 it ( 'should allow injection of GCP access tokens directly' , async ( ) => {
2543- clock = sinon . useFakeTimers ( 0 ) ;
2544+ clock = TestUtils . useFakeTimers ( sinon ) ;
25442545 const credentials = {
25452546 access_token : 'INJECTED_ACCESS_TOKEN' ,
25462547 // Simulate token expires in 10mins.
@@ -2581,7 +2582,7 @@ describe('BaseExternalAccountClient', () => {
25812582 } ) ;
25822583
25832584 it ( 'should not expire injected creds with no expiry_date' , async ( ) => {
2584- clock = sinon . useFakeTimers ( 0 ) ;
2585+ clock = TestUtils . useFakeTimers ( sinon ) ;
25852586 const credentials = {
25862587 access_token : 'INJECTED_ACCESS_TOKEN' ,
25872588 } ;
0 commit comments