TestConductor
Complete test harness with mocking capabilities.create()
Create a test conductor instance.Methods
executeEnsemble()
Execute ensemble in test mode.mock()
Mock an agent or operation.spy()
Spy on agent/operation execution.clearMocks()
Clear all mocks.reset()
Reset test conductor state.Custom Matchers
Vitest matchers for Conductor testing.Setup
Matchers
toBeSuccessful()
Assert execution succeeded.toHaveFailed()
Assert execution failed.toHaveOutput()
Assert specific output.toHaveExecutedAgent()
Assert agent was executed.toHaveExecutedOperation()
Assert operation was executed.toHaveDuration()
Assert execution duration.toMatchState()
Assert final state.Mock Implementations
MockAIProvider
Mock AI provider for testing.MockDatabase
Mock D1 database.MockKV
Mock KV namespace.MockVectorize
Mock Vectorize index.Testing Patterns
Unit Testing
Test individual agents.Integration Testing
Test complete ensembles.Mocking External Services
Testing State
Testing Errors
Best Practices
1. Use Descriptive Test NamesNext Steps
Core Classes
Core API
Testing Guide
Testing patterns
Examples
Example tests
Vitest
Vitest docs

