4 ms·
> Since the function is very simple, time would probably better spent reviewing the actual code to make sure it's error-free. I disagree with that statement. U
by seedless-sensat 6y ago
> Since the function is very simple, time would probably better spent reviewing the actual code to make sure it's error-free.
I disagree with that statement. Unit tests are very helpful for complex models, as they can guard against regressions in future changes. If the original author tested all their expectations, I am less worried that I may break something I didn't anticipate.
- reidjs 6y agoThey're also great for remembering what the heck functions do. At one of my jobs we have a file called filters.js which had hundreds of functions in it. I made it a rule that anytime I used or added one of these functions in the future I would have to write at least one unit test for it.