Co-authored-by: Max Tuzzolino <maxtuzz@Maxs-MacBook-Pro.local>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Max Tuzzolino <max.tuzsmith@gmail.com>
Co-authored-by: Ralph Khreish <35776126+Crunchyman-ralph@users.noreply.github.com>
This commit is contained in:
Eyal Toledano
2025-09-19 18:08:20 -04:00
committed by GitHub
parent 4e126430a0
commit fce841490a
55 changed files with 3559 additions and 693 deletions

View File

@@ -226,6 +226,13 @@ jest.unstable_mockModule('../../src/ai-providers/index.js', () => ({
generateObject: jest.fn(),
getRequiredApiKeyName: jest.fn(() => 'GEMINI_API_KEY'),
isRequiredApiKey: jest.fn(() => false)
})),
GrokCliProvider: jest.fn(() => ({
generateText: jest.fn(),
streamText: jest.fn(),
generateObject: jest.fn(),
getRequiredApiKeyName: jest.fn(() => 'XAI_API_KEY'),
isRequiredApiKey: jest.fn(() => false)
}))
}));

View File

@@ -148,7 +148,12 @@ const DEFAULT_CONFIG = {
enableCodebaseAnalysis: true,
responseLanguage: 'English'
},
claudeCode: {}
claudeCode: {},
grokCli: {
timeout: 120000,
workingDirectory: null,
defaultModel: 'grok-4-latest'
}
};
// Other test data (VALID_CUSTOM_CONFIG, PARTIAL_CONFIG, INVALID_PROVIDER_CONFIG)
@@ -636,7 +641,8 @@ describe('getConfig Tests', () => {
claudeCode: {
...DEFAULT_CONFIG.claudeCode,
...VALID_CUSTOM_CONFIG.claudeCode
}
},
grokCli: { ...DEFAULT_CONFIG.grokCli }
};
expect(config).toEqual(expectedMergedConfig);
expect(fsExistsSyncSpy).toHaveBeenCalledWith(MOCK_CONFIG_PATH);
@@ -678,7 +684,8 @@ describe('getConfig Tests', () => {
claudeCode: {
...DEFAULT_CONFIG.claudeCode,
...VALID_CUSTOM_CONFIG.claudeCode
}
},
grokCli: { ...DEFAULT_CONFIG.grokCli }
};
expect(config).toEqual(expectedMergedConfig);
expect(fsReadFileSyncSpy).toHaveBeenCalledWith(MOCK_CONFIG_PATH, 'utf-8');
@@ -786,7 +793,8 @@ describe('getConfig Tests', () => {
claudeCode: {
...DEFAULT_CONFIG.claudeCode,
...VALID_CUSTOM_CONFIG.claudeCode
}
},
grokCli: { ...DEFAULT_CONFIG.grokCli }
};
expect(config).toEqual(expectedMergedConfig);
});