diff options
| author | matt korwel <[email protected]> | 2025-06-19 16:52:22 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-19 16:52:22 -0700 |
| commit | 04518b52c0ddcd5ae1192763c55e472add218b3c (patch) | |
| tree | 2587b0ccc5460e9e94eb8b715956cb713950f7c8 /packages/cli/src/config/config.test.ts | |
| parent | c48fcaa8c3fe8175718b1bbfc7770a958012173c (diff) | |
Auth First Run (#1207)
Co-authored-by: Tommaso Sciortino <[email protected]>
Co-authored-by: N. Taylor Mullen <[email protected]>
Diffstat (limited to 'packages/cli/src/config/config.test.ts')
| -rw-r--r-- | packages/cli/src/config/config.test.ts | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/packages/cli/src/config/config.test.ts b/packages/cli/src/config/config.test.ts index 9ff75b15..5b24f434 100644 --- a/packages/cli/src/config/config.test.ts +++ b/packages/cli/src/config/config.test.ts @@ -247,48 +247,6 @@ describe('loadCliConfig telemetry', () => { }); }); -describe('API Key Handling', () => { - const originalEnv = { ...process.env }; - const originalArgv = process.argv; - - beforeEach(() => { - vi.resetAllMocks(); - process.argv = ['node', 'script.js']; - }); - - afterEach(() => { - process.env = originalEnv; - process.argv = originalArgv; - }); - - it('should use GEMINI_API_KEY from env', async () => { - process.env.GEMINI_API_KEY = 'gemini-key'; - delete process.env.GOOGLE_API_KEY; - - const settings: Settings = {}; - const result = await loadCliConfig(settings, [], 'test-session'); - expect(result.getContentGeneratorConfig().apiKey).toBe('gemini-key'); - }); - - it('should use GOOGLE_API_KEY and warn when both GOOGLE_API_KEY and GEMINI_API_KEY are set', async () => { - const consoleWarnSpy = vi - .spyOn(console, 'warn') - .mockImplementation(() => {}); - - process.env.GEMINI_API_KEY = 'gemini-key'; - process.env.GOOGLE_API_KEY = 'google-key'; - - const settings: Settings = {}; - const result = await loadCliConfig(settings, [], 'test-session'); - - expect(consoleWarnSpy).toHaveBeenCalledWith( - '[WARN]', - 'Both GEMINI_API_KEY and GOOGLE_API_KEY are set. Using GOOGLE_API_KEY.', - ); - expect(result.getContentGeneratorConfig().apiKey).toBe('google-key'); - }); -}); - describe('Hierarchical Memory Loading (config.ts) - Placeholder Suite', () => { beforeEach(() => { vi.resetAllMocks(); |
