3 ms·
In my case about 50% of the test code is just boilerplate, so I usually type the test name and generate the rest. Most of the time I have to rewrite the actual
by dandellion 4y ago
In my case about 50% of the test code is just boilerplate, so I usually type the test name and generate the rest. Most of the time I have to rewrite the actual test logic (although very trivial tests are sometimes correct), but I probably keep more than 40% if we're talking tests specifically.
- 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.