diff --git a/packages/cli/src/config/config.test.ts b/packages/cli/src/config/config.test.ts index 2ec764a991..5a605ea4a0 100644 --- a/packages/cli/src/config/config.test.ts +++ b/packages/cli/src/config/config.test.ts @@ -702,39 +702,6 @@ describe('Hierarchical Memory Loading (config.ts) - Placeholder Suite', () => { undefined, // maxDirs ); }); - - // NOTE TO FUTURE DEVELOPERS: - // To re-enable tests for loadHierarchicalGeminiMemory, ensure that: - // 1. os.homedir() is reliably mocked *before* the config.ts module is loaded - // and its functions (which use os.homedir()) are called. - // 2. fs/promises and fs mocks correctly simulate file/directory existence, - // readability, and content based on paths derived from the mocked os.homedir(). - // 3. Spies on console functions (for logger output) are correctly set up if needed. - // Example of a previously failing test structure: - it.skip('should correctly use mocked homedir for global path', async () => { - // This test is skipped because mockFs and fsPromises are not properly imported/mocked - // TODO: Fix this test by properly setting up mock-fs and fs/promises mocks - /* - const MOCK_GEMINI_DIR_LOCAL = path.join( - '/mock/home/user', - ServerConfig.GEMINI_DIR, - ); - const MOCK_GLOBAL_PATH_LOCAL = path.join( - MOCK_GEMINI_DIR_LOCAL, - 'GEMINI.md', - ); - mockFs({ - [MOCK_GLOBAL_PATH_LOCAL]: { type: 'file', content: 'GlobalContentOnly' }, - }); - const memory = await loadHierarchicalGeminiMemory('/some/other/cwd', false); - expect(memory).toBe('GlobalContentOnly'); - expect(vi.mocked(os.homedir)).toHaveBeenCalled(); - expect(fsPromises.readFile).toHaveBeenCalledWith( - MOCK_GLOBAL_PATH_LOCAL, - 'utf-8', - ); - */ - }); }); describe('mergeMcpServers', () => {