Skip to content

Commit 49f47c7

Browse files
committed
Fix tests
1 parent 8826846 commit 49f47c7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages-exp/app-check-exp/src/internal-api.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ describe('internal api', () => {
7272
};
7373

7474
it('uses customTokenProvider to get an AppCheck token', async () => {
75-
const clock = useFakeTimers();
7675
const customTokenProvider = getFakeCustomTokenProvider();
7776
const customProviderSpy = spy(customTokenProvider, 'getToken');
7877

@@ -83,8 +82,6 @@ describe('internal api', () => {
8382
expect(token).to.deep.equal({
8483
token: 'fake-custom-app-check-token'
8584
});
86-
87-
clock.restore();
8885
});
8986

9087
it('uses reCAPTCHA token to exchange for AppCheck token', async () => {
@@ -108,6 +105,10 @@ describe('internal api', () => {
108105
fakeRecaptchaToken
109106
);
110107
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));
111112
});
112113

113114
it('resolves with a dummy token and an error if failed to get a token', async () => {
@@ -292,7 +293,7 @@ describe('internal api', () => {
292293
expect(
293294
await getToken(app, fakePlatformLoggingProvider, true)
294295
).to.deep.equal({
295-
token: fakeRecaptchaAppCheckToken.token
296+
token: 'new-recaptcha-app-check-token'
296297
});
297298
});
298299

0 commit comments

Comments
 (0)