Fix oauth credential caching. (#2709)

This commit is contained in:
Tommaso Sciortino
2025-06-30 08:47:01 -07:00
committed by GitHub
parent f3849627fc
commit 5c4c833ddd
5 changed files with 23 additions and 25 deletions

View File

@@ -64,6 +64,7 @@ describe('oauth2', () => {
setCredentials: mockSetCredentials,
getAccessToken: mockGetAccessToken,
credentials: mockTokens,
on: vi.fn(),
} as unknown as OAuth2Client;
vi.mocked(OAuth2Client).mockImplementation(() => mockOAuth2Client);
@@ -136,10 +137,6 @@ describe('oauth2', () => {
});
expect(mockSetCredentials).toHaveBeenCalledWith(mockTokens);
const tokenPath = path.join(tempHomeDir, '.gemini', 'oauth_creds.json');
const tokenData = JSON.parse(fs.readFileSync(tokenPath, 'utf-8'));
expect(tokenData).toEqual(mockTokens);
// Verify Google Account ID was cached
const googleAccountIdPath = path.join(
tempHomeDir,