@oliverpople/agency-x
Version:
🚀 **Transform feature requests into production-ready code in seconds**
38 lines (31 loc) • 1.04 kB
text/typescript
import { runOrchestrator } from './orchestratorAgent';
// Mock the LLM router to avoid requiring real API keys
jest.mock('../llm/llmRouter', () => ({
getLlmClient: jest.fn(() => ({
generate: jest.fn().mockResolvedValue('Mock response from LLM')
}))
}));
// Mock the voice utility
jest.mock('../utils/voice', () => ({
speak: jest.fn(),
setVoiceEnabled: jest.fn(),
isVoiceEnabled: jest.fn(() => false)
}));
describe('runOrchestrator', () => {
beforeEach(() => {
// Set mock environment variables
process.env.ANTHROPIC_API_KEY = 'mock-key';
process.env.OPENAI_API_KEY = 'mock-key';
});
afterEach(() => {
jest.clearAllMocks();
});
it('should return a context object with a specId', async () => {
const result = await runOrchestrator({
feature: 'Test Feature',
maxConcurrent: 1 // Limit concurrency for test stability
});
expect(result.specId).toBeDefined();
expect(result.specId).toMatch(/^SPEC-\d{8}-[A-Z0-9]{4}$/);
}, 15000); // Increase timeout for orchestration
});