chore: apply requested changes

This commit is contained in:
Ralph Khreish
2025-09-29 16:23:37 +02:00
parent 986ac117ae
commit 100c3dc47d
17 changed files with 3052 additions and 2511 deletions

View File

@@ -24,25 +24,18 @@ const { ClaudeCodeProvider } = await import(
);
describe('Claude Code Error Handling', () => {
it('should handle missing Claude Code CLI gracefully', () => {
const provider = new ClaudeCodeProvider();
expect(() => provider.getClient()).toThrow(/Claude Code CLI not available/);
beforeEach(() => {
jest.clearAllMocks();
});
it('should handle CLI errors during client creation', () => {
const provider = new ClaudeCodeProvider();
expect(() => provider.getClient({ commandName: 'test' })).toThrow(
/Claude Code CLI not available/
);
});
it('should provide a helpful CLI-not-available error', () => {
it('should throw a CLI-not-available error (with or without commandName)', () => {
const provider = new ClaudeCodeProvider();
expect(() => provider.getClient()).toThrow(
/Claude Code CLI not available/i
);
expect(() => provider.getClient({ commandName: 'test' })).toThrow(
/Claude Code CLI not available/i
);
});
it('should still support basic provider functionality', () => {
@@ -52,6 +45,7 @@ describe('Claude Code Error Handling', () => {
expect(provider.name).toBe('Claude Code');
expect(provider.getSupportedModels()).toEqual(['sonnet', 'opus']);
expect(provider.isModelSupported('sonnet')).toBe(true);
expect(provider.isModelSupported('haiku')).toBe(false);
expect(provider.isRequiredApiKey()).toBe(false);
expect(() => provider.validateAuth()).not.toThrow();
});