Skip to content

Commit a78d964

Browse files
committed
fix typo
1 parent 4f36728 commit a78d964

File tree

1 file changed

+28
-8
lines changed

1 file changed

+28
-8
lines changed

packages/auth/src/core/auth/auth_impl.test.ts

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ describe('core/auth/auth_impl', () => {
312312
auth.setTokenRefreshHandler(handler);
313313
expect((auth as any).tokenRefreshHandler).to.eq(handler);
314314
});
315+
});
315316

316317
describe('#getFirebaseAccessToken', () => {
317318
let exchangeTokenStub: sinon.SinonStub;
@@ -323,7 +324,9 @@ describe('core/auth/auth_impl', () => {
323324
}`;
324325

325326
beforeEach(() => {
326-
exchangeTokenStub = sinon.stub(exchangeTokenModule, 'exchangeToken').resolves();
327+
exchangeTokenStub = sinon
328+
.stub(exchangeTokenModule, 'exchangeToken')
329+
.resolves();
327330

328331
mockToken = {
329332
token: 'test-token',
@@ -374,7 +377,11 @@ describe('core/auth/auth_impl', () => {
374377
const token = await auth.getFirebaseAccessToken();
375378

376379
expect(tokenRefreshHandler.refreshIdpToken).to.have.been.calledOnce;
377-
expect(exchangeTokenStub).to.have.been.calledWith(auth, 'test-idp', 'new-id-token');
380+
expect(exchangeTokenStub).to.have.been.calledWith(
381+
auth,
382+
'test-idp',
383+
'new-id-token'
384+
);
378385
expect(token).to.eql(mockToken);
379386
});
380387

@@ -389,31 +396,44 @@ describe('core/auth/auth_impl', () => {
389396
await auth.getFirebaseAccessToken(true);
390397

391398
expect(tokenRefreshHandler.refreshIdpToken).to.have.been.calledOnce;
392-
expect(exchangeTokenStub).to.have.been.calledWith(auth, 'test-idp', 'new-id-token');
399+
expect(exchangeTokenStub).to.have.been.calledWith(
400+
auth,
401+
'test-idp',
402+
'new-id-token'
403+
);
393404
});
394405

395406
it('should return null and log an error if token refresh fails', async () => {
396407
const consoleErrorStub = sinon.stub(console, 'error');
397408
persistenceStub._get.withArgs(tokenKey).resolves(expiredMockToken as any);
398-
(tokenRefreshHandler.refreshIdpToken as sinon.SinonStub).rejects(new Error('refresh failed'));
409+
(tokenRefreshHandler.refreshIdpToken as sinon.SinonStub).rejects(
410+
new Error('refresh failed')
411+
);
399412
auth.setTokenRefreshHandler(tokenRefreshHandler);
400413
const token = await auth.getFirebaseAccessToken();
401414
expect(token).to.be.null;
402-
expect(consoleErrorStub).to.have.been.calledWith('Token refresh failed:', sinon.match.instanceOf(Error));
415+
expect(consoleErrorStub).to.have.been.calledWith(
416+
'Token refresh failed:',
417+
sinon.match.instanceOf(Error)
418+
);
403419
});
404420

405421
it('should return null and log an error if the refreshed token is invalid', async () => {
406422
const consoleErrorStub = sinon.stub(console, 'error');
407423
persistenceStub._get.withArgs(tokenKey).resolves(expiredMockToken as any);
408-
(tokenRefreshHandler.refreshIdpToken as sinon.SinonStub).resolves({ idToken: 'new-id-token' }); // Missing idpConfigId
424+
(tokenRefreshHandler.refreshIdpToken as sinon.SinonStub).resolves({
425+
idToken: 'new-id-token'
426+
}); // Missing idpConfigId
409427
auth.setTokenRefreshHandler(tokenRefreshHandler);
410428
const token = await auth.getFirebaseAccessToken();
411429
expect(token).to.be.null;
412-
expect(consoleErrorStub).to.have.been.calledWith('Token refresh failed:', sinon.match.instanceOf(FirebaseError));
430+
expect(consoleErrorStub).to.have.been.calledWith(
431+
'Token refresh failed:',
432+
sinon.match.instanceOf(FirebaseError)
433+
);
413434
});
414435
});
415436

416-
417437
describe('#signOut', () => {
418438
it('sets currentUser to null, calls remove', async () => {
419439
await auth._updateCurrentUser(testUser(auth, 'test'));

0 commit comments

Comments
 (0)