Hacker News new | past | comments | ask | show | jobs | submit login

I think part of the motivation for one assertion per test comes from the fact that you stop getting information from a test as soon as one assertion fails.

I think it was a guidance, like the SRP where you should be testing one thing in each test case. I also think a growing number of assertions might be a sign your unit under test is wearing too many responsibilities.

Maybe it’s better to say “few assertions, all related to testing one thing”




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: