@@ -72,7 +72,6 @@ describe('internal api', () => {
72
72
} ;
73
73
74
74
it ( 'uses customTokenProvider to get an AppCheck token' , async ( ) => {
75
- const clock = useFakeTimers ( ) ;
76
75
const customTokenProvider = getFakeCustomTokenProvider ( ) ;
77
76
const customProviderSpy = spy ( customTokenProvider , 'getToken' ) ;
78
77
@@ -83,8 +82,6 @@ describe('internal api', () => {
83
82
expect ( token ) . to . deep . equal ( {
84
83
token : 'fake-custom-app-check-token'
85
84
} ) ;
86
-
87
- clock . restore ( ) ;
88
85
} ) ;
89
86
90
87
it ( 'uses reCAPTCHA token to exchange for AppCheck token' , async ( ) => {
@@ -108,6 +105,10 @@ describe('internal api', () => {
108
105
fakeRecaptchaToken
109
106
) ;
110
107
expect ( token ) . to . deep . equal ( { token : fakeRecaptchaAppCheckToken . token } ) ;
108
+ // TODO: Permanently fix.
109
+ // Small delay to prevent common test flakiness where this test runs
110
+ // into afterEach() sometimes
111
+ await new Promise ( resolve => setTimeout ( resolve , 50 ) ) ;
111
112
} ) ;
112
113
113
114
it ( 'resolves with a dummy token and an error if failed to get a token' , async ( ) => {
@@ -292,7 +293,7 @@ describe('internal api', () => {
292
293
expect (
293
294
await getToken ( app , fakePlatformLoggingProvider , true )
294
295
) . to . deep . equal ( {
295
- token : fakeRecaptchaAppCheckToken . token
296
+ token : 'new-recaptcha-app-check- token'
296
297
} ) ;
297
298
} ) ;
298
299
0 commit comments