mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-21 11:30:38 -07:00
fix: handle missing local extension config and skip hooks when disabled (#14744)
This commit is contained in:
@@ -43,6 +43,7 @@ vi.mock('@google/gemini-cli-core', async (importOriginal) => {
|
||||
debugLogger: {
|
||||
error: vi.fn(),
|
||||
log: vi.fn(),
|
||||
warn: vi.fn(),
|
||||
},
|
||||
};
|
||||
});
|
||||
@@ -263,6 +264,25 @@ describe('github.ts', () => {
|
||||
ExtensionUpdateState.UP_TO_DATE,
|
||||
);
|
||||
});
|
||||
|
||||
it('should return NOT_UPDATABLE if local extension config cannot be loaded', async () => {
|
||||
vi.mocked(mockExtensionManager.loadExtensionConfig).mockImplementation(
|
||||
() => {
|
||||
throw new Error('Config not found');
|
||||
},
|
||||
);
|
||||
|
||||
const ext = {
|
||||
name: 'local-ext',
|
||||
version: '1.0.0',
|
||||
path: '/path/to/installed/ext',
|
||||
installMetadata: { type: 'local', source: '/path/to/source/ext' },
|
||||
} as unknown as GeminiCLIExtension;
|
||||
|
||||
expect(await checkForExtensionUpdate(ext, mockExtensionManager)).toBe(
|
||||
ExtensionUpdateState.NOT_UPDATABLE,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('downloadFromGitHubRelease', () => {
|
||||
|
||||
Reference in New Issue
Block a user