4 ms·
> In my case about 50% of the test code is just boilerplate Why not replace it with a function call?
by paro_nej 4y ago
> In my case about 50% of the test code is just boilerplate
Why not replace it with a function call?
- aaomidi 4y agoSome languages are just noisy. Go, Java I’ve experienced are noisier than others.
- travisjungroth 4y agoA common occurrence is something like a pool of 10 actions where a bunch of tests each do 3 to 7 of them. This is very hard to abstract with a function call.
- lupire 4y agoThat makes the test harder to read. Tests should be dumb.
- dandellion 4y agoIn the case I was referring to, mainly to keep the code consistent with what was already there and the PRs small, as the code base is primarily owned by a different team. It's also pretty innocuous short tests that read well as they are.