summaryrefslogtreecommitdiff
path: root/packages/core/src/code_assist/oauth2.test.ts
diff options
context:
space:
mode:
authorMarat Boshernitsan <[email protected]>2025-08-15 22:05:59 -0700
committerGitHub <[email protected]>2025-08-16 05:05:59 +0000
commitbc60257e220a77c2d6e57ea4bfd1f0a483a1344c (patch)
tree6449a959edc2e652e746a25589a8122f2f474ded /packages/core/src/code_assist/oauth2.test.ts
parent6c1373c33212e26521701acf73c0398721b3a881 (diff)
feat(oauth): Make oauth client a singleton to survive cache failures (#6348)
Diffstat (limited to 'packages/core/src/code_assist/oauth2.test.ts')
-rw-r--r--packages/core/src/code_assist/oauth2.test.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/core/src/code_assist/oauth2.test.ts b/packages/core/src/code_assist/oauth2.test.ts
index 32c8ad3c..77a8fb90 100644
--- a/packages/core/src/code_assist/oauth2.test.ts
+++ b/packages/core/src/code_assist/oauth2.test.ts
@@ -5,7 +5,7 @@
*/
import { describe, it, expect, vi, beforeEach, afterEach, Mock } from 'vitest';
-import { getOauthClient } from './oauth2.js';
+import { getOauthClient, resetOauthClientForTesting } from './oauth2.js';
import { getCachedGoogleAccount } from '../utils/user_account.js';
import { OAuth2Client, Compute } from 'google-auth-library';
import * as fs from 'fs';
@@ -56,6 +56,7 @@ describe('oauth2', () => {
afterEach(() => {
fs.rmSync(tempHomeDir, { recursive: true, force: true });
vi.clearAllMocks();
+ resetOauthClientForTesting();
delete process.env.CLOUD_SHELL;
delete process.env.GOOGLE_GENAI_USE_GCA;
delete process.env.GOOGLE_CLOUD_ACCESS_TOKEN;