Skip to content

Commit d3f3d91

Browse files
authored
Fixing a flaky test case (#733)
1 parent 99d3214 commit d3f3d91

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/unit/auth/auth.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import {
4242
} from '../../../src/auth/auth-config';
4343
import {deepCopy} from '../../../src/utils/deep-copy';
4444
import { TenantManager } from '../../../src/auth/tenant-manager';
45+
import { HttpClient } from '../../../src/utils/api-request';
4546

4647
chai.should();
4748
chai.use(sinonChai);
@@ -357,7 +358,8 @@ AUTH_CONFIGS.forEach((testConfig) => {
357358

358359
it('should be eventually rejected if a cert credential is not specified', () => {
359360
const mockCredentialAuth = testConfig.init(mocks.mockCredentialApp());
360-
361+
// Force the service account ID discovery to fail.
362+
getTokenStub = sinon.stub(HttpClient.prototype, 'send').rejects(utils.errorFrom({}));
361363
return mockCredentialAuth.createCustomToken(mocks.uid, mocks.developerClaims)
362364
.should.eventually.be.rejected.and.have.property('code', 'auth/invalid-credential');
363365
});

0 commit comments

Comments
 (0)