TLDR Web Dev · ARTICLES & TUTORIALS
THE GOLDEN RULE OF ASSERTIONS
Summary from the TLDR Web Dev newsletter
For effective testing, a test should fail if, and only if, the intention behind the system is not met. All tests should focus on the intention of the code being tested and avoid testing implementation details, which could lead to false test failures. Following these guidelines helps define test boundaries properly and has developers consider external factors like dependencies more accurately.