From 21c6480b65528a98ac0e1e3855f3c78c1f9b7cbe Mon Sep 17 00:00:00 2001 From: Yuki Okita Date: Wed, 20 Aug 2025 10:55:47 +0900 Subject: Refac: Centralize storage file management (#4078) Co-authored-by: Taylor Mullen --- packages/cli/src/ui/commands/restoreCommand.test.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'packages/cli/src/ui/commands/restoreCommand.test.ts') diff --git a/packages/cli/src/ui/commands/restoreCommand.test.ts b/packages/cli/src/ui/commands/restoreCommand.test.ts index 23f71499..b9ecc139 100644 --- a/packages/cli/src/ui/commands/restoreCommand.test.ts +++ b/packages/cli/src/ui/commands/restoreCommand.test.ts @@ -39,7 +39,10 @@ describe('restoreCommand', () => { mockConfig = { getCheckpointingEnabled: vi.fn().mockReturnValue(true), - getProjectTempDir: vi.fn().mockReturnValue(geminiTempDir), + storage: { + getProjectTempCheckpointsDir: vi.fn().mockReturnValue(checkpointsDir), + getProjectTempDir: vi.fn().mockReturnValue(geminiTempDir), + }, getGeminiClient: vi.fn().mockReturnValue({ setHistory: mockSetHistory, }), @@ -77,7 +80,9 @@ describe('restoreCommand', () => { describe('action', () => { it('should return an error if temp dir is not found', async () => { - vi.mocked(mockConfig.getProjectTempDir).mockReturnValue(''); + vi.mocked( + mockConfig.storage.getProjectTempCheckpointsDir, + ).mockReturnValue(''); expect( await restoreCommand(mockConfig)?.action?.(mockContext, ''), @@ -219,7 +224,7 @@ describe('restoreCommand', () => { describe('completion', () => { it('should return an empty array if temp dir is not found', async () => { - vi.mocked(mockConfig.getProjectTempDir).mockReturnValue(''); + vi.mocked(mockConfig.storage.getProjectTempDir).mockReturnValue(''); const command = restoreCommand(mockConfig); expect(await command?.completion?.(mockContext, '')).toEqual([]); -- cgit v1.2.3