Documentation
README
Writing Good Tests
Philosophy
"Write tests. Not too many. Mostly integration." โ Kent C. Dodds
Tests verify real behavior, not implementation details. The goal is confidence that your code works, not coverage numbers.
Core principles:
- Test behavior, not implementation โ refactoring shouldn't break tests
- Integration tests provide better confidence-to-cost ratio than unit tests
- Wait for actual conditions, not arbitrary timeouts
- Mock strategically โ real dependencies when feasible, mocks for external systems
- Don't pollute production code with test-only methods
Test Structure
Use Arrange-Act-Assert (or Given-When-Then):
This is the opening of the README. Read the full README on GitHub.