Hacker News new | ask | show | jobs
by paro_nej 1192 days ago
> In my case about 50% of the test code is just boilerplate

Why not replace it with a function call?

4 comments

A 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.
That makes the test harder to read. Tests should be dumb.
In 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.
Some languages are just noisy.

Go, Java I’ve experienced are noisier than others.