Skip to content

Ask HN: Devs: Do you find any value in Arrange, Act Assert comments in tests?

1 pointilitirit2 comments
On HN

I personally consider them to be noise so I never use them. In fact I usually remove them if I come across them in files I'm working on. But I'm curious to hear about what I could potentially be missing with regards to their value.

Comments

Yes, I find them valuable.

The quality of engineer varies wildly across my organization, so it at least gives tests some basic structure.

Same here, it gives me structure if the amount of arrange code is large. It also gives me structure when writing, as it can sometimes be very tempting to mix act and assert statements

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.