Overview
Comprehensive testing ensures code quality and reliability across the Olis monorepo.Running Tests
Test Types
Unit Tests
Test individual functions and components in isolation
Integration Tests
Test interactions between components and services
E2E Tests
Test complete user workflows from start to finish
API Tests
Test API endpoints and responses
Electron Client Testing
Unit Tests with Jest
E2E Tests with Playwright
API Server Testing
pytest Integration Tests
Best Practices
Write Testable Code
Write Testable Code
- Small, focused functions
- Avoid side effects
- Use dependency injection
- Mock external dependencies
Test Coverage
Test Coverage
- Aim for 80%+ coverage
- Focus on critical paths
- Don’t test implementation details
- Test behavior, not code
Test Organization
Test Organization
- Mirror source structure
- Group related tests
- Clear test names
- Arrange-Act-Assert pattern