Test against the public API of the code under test.
Test private APIs if and only if the private component is highly complex and difficult to test through the public API.
Use
insta
whenever you are testing output that is difficult to predict or compare.
Where appropriate, use
proptest
to add property-based tests for key invariants.
Testing code should be written with the same care reserved to production code.
Avoid unnecessary duplication, introduce helpers to reduce boilerplate and ensure readability.
The intent of a test should be obvious or, if not possible, clearly documented.
Do not reference exact line numbers in comments, as they may change over time.