We explore a number of issues related to assertion size. Should we limit ourselves to one assertion per test? That question is much more difficult to answer than it seems. Should we assert "about" an object's attributes, or should we construct an expected value and assert the entire object "against" it? If we choose the right one in the right circumstance, the test itself can alert us to missing coverage.

Execute Program

Looking for something more interactive? Try Execute Program, an interactive learning platform from Destroy All Software LLC! It has courses on TypeScript, SQL, regular expressions, JavaScript concurrency, and more. All Destroy All Software subscriptions include full access to Execute Program, or you can subscribe to Execute Program directly.