Hacker News new | ask | show | jobs
by joshuamorton 839 days ago
But vastly faster.

A good rule of thumb for a unit test is that you should be able to run it a few thousand times in a relatively brief period (think: minutes or less) and it shouldn't ever fail/flake.

If a unit test (suite) takes more than a single digit number of seconds to run, it isn't a unit test. Integration tests are good to have, but unit tests should be really cheap and fundamentally a tool for iterative and interactive development. I should be able to run some of my unit tests on every save, and have them keep pace with my linter.

1 comments

Testcontainers don't typically add more than a few seconds to a suite though. They are very fast.