2 ms·
I'm not sure I agree. I like to move all setup code to helper methods so that my tests are just a few lines // Given <setup> // When <thing happens>
by therealdrag0 7y ago
I'm not sure I agree. I like to move all setup code to helper methods so that my tests are just a few lines
// Given <setup>
// When <thing happens>
// Expect <thing> to be <such>
This allows the reader to easily see which workflows are actually tested. If the reader is interested in implementations the utility code is one click away and usually only needs to be looked at once to be completely understood. The test bodies themselves however have many flavors for many work-flows so getting rid of the repetition is critical to highlight the specific nature of individual tests.