style: apply biome formatting to test files

This commit is contained in:
Ben Vargas
2025-06-17 13:38:19 -06:00
committed by Ralph Khreish
parent 5d82b69610
commit 18a5f63d06
3 changed files with 131 additions and 73 deletions

View File

@@ -18,7 +18,9 @@ jest.unstable_mockModule('@anthropic-ai/claude-code', () => {
});
// Import after mocking
const { ClaudeCodeProvider } = await import('../../src/ai-providers/claude-code.js');
const { ClaudeCodeProvider } = await import(
'../../src/ai-providers/claude-code.js'
);
describe('Claude Code Optional Dependency Integration', () => {
describe('when @anthropic-ai/claude-code is not installed', () => {
@@ -43,10 +45,14 @@ describe('Claude Code Optional Dependency Integration', () => {
const model = client('opus');
// The actual usage should fail with the lazy loading error
await expect(model.doGenerate({
prompt: [{ role: 'user', content: 'Hello' }],
mode: { type: 'regular' }
})).rejects.toThrow("Claude Code SDK is not installed. Please install '@anthropic-ai/claude-code' to use the claude-code provider.");
await expect(
model.doGenerate({
prompt: [{ role: 'user', content: 'Hello' }],
mode: { type: 'regular' }
})
).rejects.toThrow(
"Claude Code SDK is not installed. Please install '@anthropic-ai/claude-code' to use the claude-code provider."
);
});
it('should provide helpful error message for streaming', async () => {
@@ -54,10 +60,14 @@ describe('Claude Code Optional Dependency Integration', () => {
const client = provider.getClient({});
const model = client('sonnet');
await expect(model.doStream({
prompt: [{ role: 'user', content: 'Hello' }],
mode: { type: 'regular' }
})).rejects.toThrow("Claude Code SDK is not installed. Please install '@anthropic-ai/claude-code' to use the claude-code provider.");
await expect(
model.doStream({
prompt: [{ role: 'user', content: 'Hello' }],
mode: { type: 'regular' }
})
).rejects.toThrow(
"Claude Code SDK is not installed. Please install '@anthropic-ai/claude-code' to use the claude-code provider."
);
});
});
@@ -74,7 +84,7 @@ describe('Claude Code Optional Dependency Integration', () => {
// when the actual model is used
const provider = new ClaudeCodeProvider();
expect(provider).toBeDefined();
// In real usage, ai-services-unified would:
// 1. Get the provider instance (works)
// 2. Call provider.getClient() (works)
@@ -82,4 +92,4 @@ describe('Claude Code Optional Dependency Integration', () => {
// 4. Try to generate (fails with clear error)
});
});
});
});