mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-21 17:27:54 +00:00
Extensibility: Gemini.md files (#944)
This commit is contained in:
@@ -58,8 +58,11 @@ vi.mock('@gemini-cli/core', async () => {
|
||||
setUserMemory: vi.fn(),
|
||||
setGeminiMdFileCount: vi.fn(),
|
||||
})),
|
||||
loadServerHierarchicalMemory: vi.fn(() =>
|
||||
Promise.resolve({ memoryContent: '', fileCount: 0 }),
|
||||
loadServerHierarchicalMemory: vi.fn((cwd, debug, extensionPaths) =>
|
||||
Promise.resolve({
|
||||
memoryContent: extensionPaths?.join(',') || '',
|
||||
fileCount: extensionPaths?.length || 0,
|
||||
}),
|
||||
),
|
||||
};
|
||||
});
|
||||
@@ -228,15 +231,31 @@ describe('Hierarchical Memory Loading (config.ts) - Placeholder Suite', () => {
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('should have a placeholder test to ensure test file validity', () => {
|
||||
// This test suite is currently a placeholder.
|
||||
// Tests for loadHierarchicalGeminiMemory were removed due to persistent
|
||||
// and complex mocking issues with Node.js built-in modules (like 'os')
|
||||
// in the Vitest environment. These issues prevented consistent and reliable
|
||||
// testing of file system interactions dependent on os.homedir().
|
||||
// The core logic was implemented as per specification, but the tests
|
||||
// could not be stabilized.
|
||||
expect(true).toBe(true);
|
||||
it('should pass extension context file paths to loadServerHierarchicalMemory', async () => {
|
||||
process.argv = ['node', 'script.js'];
|
||||
const settings: Settings = {};
|
||||
const extensions = [
|
||||
{
|
||||
name: 'ext1',
|
||||
version: '1.0.0',
|
||||
contextFileName: '/path/to/ext1/gemini.md',
|
||||
},
|
||||
{
|
||||
name: 'ext2',
|
||||
version: '1.0.0',
|
||||
},
|
||||
{
|
||||
name: 'ext3',
|
||||
version: '1.0.0',
|
||||
contextFileName: '/path/to/ext3/gemini.md',
|
||||
},
|
||||
];
|
||||
await loadCliConfig(settings, extensions, [], 'session-id');
|
||||
expect(ServerConfig.loadServerHierarchicalMemory).toHaveBeenCalledWith(
|
||||
expect.any(String),
|
||||
false,
|
||||
['/path/to/ext1/gemini.md', '/path/to/ext3/gemini.md'],
|
||||
);
|
||||
});
|
||||
|
||||
// NOTE TO FUTURE DEVELOPERS:
|
||||
|
||||
Reference in New Issue
Block a user