Guides
Testing Guide
Testing Guide
Testing standards and practices for Synap Backend
Testing Strategy
Unit Tests
- Test individual functions and classes
- Mock external dependencies
- Fast execution (< 100ms per test)
Integration Tests
- Test component interactions
- Use test database
- Test event flows
E2E Tests
- Test complete user flows
- Use real services (Docker)
- Validate end-to-end behavior
Test Structure
Testing Event Handlers
Testing Agents
Best Practices
- Test behavior, not implementation - Focus on outcomes
- Use fixtures - Reusable test data
- Mock external services - Don't call real APIs
- Test error cases - Invalid inputs, failures
- Keep tests fast - Use mocks and stubs
Next: See Code Style for coding standards.
