Skip to content

Commit 1b9b65f

Browse files
committed
test: add unit tests for LiteLLM provider
1 parent 17afd30 commit 1b9b65f

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { describe, it, expect } from 'vitest';
2+
import { AiProvider, defaultModels, isValidProvider, getDefaultModel } from '../../shared/src/ai.mjs';
3+
4+
describe('LiteLLM provider registration', () => {
5+
it('should include litellm in AiProvider enum', () => {
6+
expect(AiProvider.LiteLLM).toBe('litellm');
7+
});
8+
9+
it('should have a default model for litellm', () => {
10+
expect(defaultModels[AiProvider.LiteLLM]).toBeDefined();
11+
expect(defaultModels[AiProvider.LiteLLM]).toBe('gpt-4o-mini');
12+
});
13+
14+
it('should validate litellm as a valid provider', () => {
15+
expect(isValidProvider('litellm')).toBe(true);
16+
});
17+
18+
it('should return default model for litellm', () => {
19+
expect(getDefaultModel('litellm')).toBe('gpt-4o-mini');
20+
});
21+
22+
it('should not break existing providers', () => {
23+
expect(isValidProvider('openai')).toBe(true);
24+
expect(isValidProvider('anthropic')).toBe(true);
25+
expect(isValidProvider('custom')).toBe(true);
26+
expect(isValidProvider('openrouter')).toBe(true);
27+
});
28+
29+
it('should reject invalid providers', () => {
30+
expect(isValidProvider('nonexistent')).toBe(false);
31+
});
32+
});

0 commit comments

Comments
 (0)