Testing Guide
Station has comprehensive test coverage across unit, integration, and end-to-end tests.Running Tests
All Tests
Specific Packages
Test Coverage
Test Structure
Writing Tests
Unit Test Pattern
Table-Driven Tests
Station uses table-driven tests extensively:Mocking
Station uses interfaces for testability. Generate mocks with:Integration Tests
Integration tests use real databases and services:API Tests
Database Tests
Test Helpers
Test Database Setup
Test Fixtures
Continuous Integration
Tests run automatically on:- Every push to
main - Every pull request
- Release tag creation
Testing Best Practices
- Test behavior, not implementation - Focus on what the code does, not how
- Use table-driven tests - Makes adding test cases easy
- Mock at boundaries - Mock external services, not internal code
- Keep tests fast - Use in-memory databases, skip slow tests with
-short - Test error cases - Ensure errors are handled correctly
- Clean up resources - Use
deferfor cleanup - Use meaningful names - Test names should describe the scenario
Next Steps
Code Style
Coding conventions and standards
Architecture
Understanding the codebase structure

