What to Test

Tests should provide confidence at the right level. Pure utility functions are cheap to unit test. Components and user workflows benefit from integration-style tests. A smaller number of end-to-end tests validate critical journeys in a real browser.

Avoid testing implementation details such as private state variable names or internal hook calls. Prefer observable behavior: what the user sees, clicks, types, and receives.

The most valuable tests protect business behavior that would be expensive to break.

Testing Layers
Key Takeaways
  • Test behavior rather than implementation details.
  • Use the lowest level that gives meaningful confidence.
  • Protect critical user journeys with end-to-end coverage.