3 ms·
Testing budgets are important by disqualifying a test because it's "slow" is really silly. 1. Tests that hit APIs and databases are important because when you
by davewritescode 6y ago
Testing budgets are important by disqualifying a test because it's "slow" is really silly.
1. Tests that hit APIs and databases are important because when you mock out the database and the API you're writing a test that asserts your code integrates correctly with what you think the database or API should be doing.
2. Some systems are highly asynchronous and thus very difficult to test individual cases in under 100 ms.
If I have a suite of 100 tests that completes in 10 seconds because everything runs concurrently, that's a lot more important than limiting and individual test to some arbitrary timespan.
Again, make a budget for tests and meet it instead of making hard rules about how fast or slow a given test should be.