11
I used to skip unit tests, then one bug cost me 6 hours
I always thought mocking around with test files was a waste of time for small projects. Last week a typo in a helper function broke my signup form and I spent 6 hours chasing it, while a simple test would have caught it in 2 minutes. Now I write basic tests for every function before moving on, anyone else start testing late and regret it?
2 comments
Log in to join the discussion
Log In2 Comments
emmaj3320d ago
Ha, I feel you but I'm on the other side here. I've gotten away with zero tests on a few small projects and honestly, sometimes the extra time writing them feels like its own kind of bug factory. I get why you'd want them now, but for me, a quick console.log still does the job for most tiny stuff.
5
king.andrew19d ago
Might just be me, but console.log starts to break down the second a tiny project grows a database or a callback chain. @emmaj33, back when I skipped tests on a small script, it was fine until a teammate changed one line and everything quietly died. Nobody noticed because the log output looked right, but the actual state was off. A few basic tests catch those silent failures for way less effort than debugging them later.
3