29 ms·
So you made a change and a test broke, what about all the ones that didn't break? They still represent a lot of scenarios you probably wouldn't have tested manu
by flukus 8y ago
So you made a change and a test broke, what about all the ones that didn't break? They still represent a lot of scenarios you probably wouldn't have tested manually.
I would also guess that the problems with your tests breaking are because you're not following the single assert principle. A unit test should generally (plenty of exceptions) not break unless the specific behavior (the unit) it is testing for changes. A common anti-pattern is to treat tests as scenarios, setup the scenario, test it and check everything went as expected for that scenario. Instead you want to work out the behavior you're testing, "foobar gets written to the log" is a test and the setup should be just enough to produce that behavior..