# Unit Tests
Fast, isolated tests with mocked dependencies.
**Characteristics:**
- Execution time: <5 seconds total
- Dependencies: All external APIs mocked
- Run in: CI/CD pipeline
- Coverage target: 80% of critical components
**Structure:**
- `tools/` - Tests for individual MCP tools (create-company, search-people, etc.)
- `utils/` - Tests for utility functions (error handling, validation)
- `lib/` - Tests for library code (schema cache, helpers)
**Running:**
```bash
npm run test:unit # Run all unit tests
npm run test:watch # Watch mode for development
npm run test:coverage # Run with coverage report
```
**Writing Unit Tests:**
- Use MockAttioClient from `tests/helpers/mock-attio-client.ts`
- Use fixtures from `tests/fixtures/` for test data
- Focus on business logic, not API communication
- Test edge cases and error conditions