3 ms·
Actually I agree with you, and also forgot to mention that tests themselves because of being code should be cleaned up just like with regular code and tests sim
by hnedeotes 6y ago
Actually I agree with you, and also forgot to mention that tests themselves because of being code should be cleaned up just like with regular code and tests simplified whenever possible.
I think the important question is what to be tested. I have written, even not that long ago, unit tests for a function that all passed in isolation and actually forgot to write a simple test with the context it would be called (which was very simple as well, but I just didn't), all isolated tests were good but the actual functionality was still broken.
I haven't been doing it extensively for a long time but for instance, if you have an user action that should update a record, write a job to be executed, then this should be tested. It's easy and does very small assumptions. You don't need to test how the record is updated or the job inserted, just that it happens. You might want to test that all failures provide correct error messages, but that is not as important as at least having the baseline of, if this action that is central happens both these things happen as well.