diff options
Diffstat (limited to 'packages/cli/src/ui/hooks')
| -rw-r--r-- | packages/cli/src/ui/hooks/useGeminiStream.test.tsx | 7 | ||||
| -rw-r--r-- | packages/cli/src/ui/hooks/useGeminiStream.ts | 2 |
2 files changed, 3 insertions, 6 deletions
diff --git a/packages/cli/src/ui/hooks/useGeminiStream.test.tsx b/packages/cli/src/ui/hooks/useGeminiStream.test.tsx index 37d63e9a..9eed0912 100644 --- a/packages/cli/src/ui/hooks/useGeminiStream.test.tsx +++ b/packages/cli/src/ui/hooks/useGeminiStream.test.tsx @@ -51,6 +51,7 @@ const MockedGeminiClientClass = vi.hoisted(() => const MockedUserPromptEvent = vi.hoisted(() => vi.fn().mockImplementation(() => {}), ); +const mockParseAndFormatApiError = vi.hoisted(() => vi.fn()); vi.mock('@google/gemini-cli-core', async (importOriginal) => { const actualCoreModule = (await importOriginal()) as any; @@ -59,6 +60,7 @@ vi.mock('@google/gemini-cli-core', async (importOriginal) => { GitService: vi.fn(), GeminiClient: MockedGeminiClientClass, UserPromptEvent: MockedUserPromptEvent, + parseAndFormatApiError: mockParseAndFormatApiError, }; }); @@ -127,11 +129,6 @@ vi.mock('./slashCommandProcessor.js', () => ({ handleSlashCommand: vi.fn().mockReturnValue(false), })); -const mockParseAndFormatApiError = vi.hoisted(() => vi.fn()); -vi.mock('../utils/errorParsing.js', () => ({ - parseAndFormatApiError: mockParseAndFormatApiError, -})); - // --- END MOCKS --- describe('mergePartListUnions', () => { diff --git a/packages/cli/src/ui/hooks/useGeminiStream.ts b/packages/cli/src/ui/hooks/useGeminiStream.ts index 6f3cb4fd..99b727b6 100644 --- a/packages/cli/src/ui/hooks/useGeminiStream.ts +++ b/packages/cli/src/ui/hooks/useGeminiStream.ts @@ -25,6 +25,7 @@ import { UnauthorizedError, UserPromptEvent, DEFAULT_GEMINI_FLASH_MODEL, + parseAndFormatApiError, } from '@google/gemini-cli-core'; import { type Part, type PartListUnion, FinishReason } from '@google/genai'; import { @@ -37,7 +38,6 @@ import { ToolCallStatus, } from '../types.js'; import { isAtCommand } from '../utils/commandUtils.js'; -import { parseAndFormatApiError } from '../utils/errorParsing.js'; import { useShellCommandProcessor } from './shellCommandProcessor.js'; import { handleAtCommand } from './atCommandProcessor.js'; import { findLastSafeSplitPoint } from '../utils/markdownUtilities.js'; |
