mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-23 20:40:41 -07:00
Make merged settings non-nullable and fix all lints related to that. (#16647)
This commit is contained in:
@@ -271,9 +271,10 @@ describe('hooksCommand', () => {
|
||||
|
||||
it('should enable a hook and update settings', async () => {
|
||||
// Update the context's settings with disabled hooks
|
||||
mockContext.services.settings.merged.hooks = {
|
||||
disabled: ['test-hook', 'other-hook'],
|
||||
};
|
||||
mockContext.services.settings.merged.hooks.disabled = [
|
||||
'test-hook',
|
||||
'other-hook',
|
||||
];
|
||||
|
||||
const enableCmd = hooksCommand.subCommands!.find(
|
||||
(cmd) => cmd.name === 'enable',
|
||||
@@ -401,9 +402,7 @@ describe('hooksCommand', () => {
|
||||
});
|
||||
|
||||
it('should disable a hook and update settings', async () => {
|
||||
mockContext.services.settings.merged.hooks = {
|
||||
disabled: [],
|
||||
};
|
||||
mockContext.services.settings.merged.hooks.disabled = [];
|
||||
|
||||
const disableCmd = hooksCommand.subCommands!.find(
|
||||
(cmd) => cmd.name === 'disable',
|
||||
@@ -432,9 +431,7 @@ describe('hooksCommand', () => {
|
||||
|
||||
it('should return info when hook is already disabled', async () => {
|
||||
// Update the context's settings with the hook already disabled
|
||||
mockContext.services.settings.merged.hooks = {
|
||||
disabled: ['test-hook'],
|
||||
};
|
||||
mockContext.services.settings.merged.hooks.disabled = ['test-hook'];
|
||||
|
||||
const disableCmd = hooksCommand.subCommands!.find(
|
||||
(cmd) => cmd.name === 'disable',
|
||||
@@ -455,9 +452,7 @@ describe('hooksCommand', () => {
|
||||
});
|
||||
|
||||
it('should handle error when disabling hook fails', async () => {
|
||||
mockContext.services.settings.merged.hooks = {
|
||||
disabled: [],
|
||||
};
|
||||
mockContext.services.settings.merged.hooks.disabled = [];
|
||||
mockSettings.setValue.mockImplementationOnce(() => {
|
||||
throw new Error('Failed to save settings');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user