ginkgo icon indicating copy to clipboard operation
ginkgo copied to clipboard

Enable describing the actions of the BeforeEach and AfterEach nodes

Open felipe88alves opened this issue 2 years ago • 1 comments

Perhaps this is a question as much as it is a request for improvement.

Is there a strong reason for not adding the <description> parameter to the BeforeEach and AfterEach nodes? I find that it would really increase the readability of the code.

I.e:

Describe("Begin testing custom controller", func() {
	BeforeEach("Create Fake CR and adjacent resources for testing", func() {
	Context("The CR exists", func() {
		AfterEach("Cleanup of CR and managed resources", func() {
			....

felipe88alves avatar Sep 15 '22 10:09 felipe88alves

hey @felipe88alves - no strong reason. I've generally found the text in the contexts/describes/Its is enough to help understand what a BeforeEach is doing. And if there is need for additional documentation most users throw in a By. We could add descriptions to setup nodes - I'm not opposed; but it's gonna be a bit of a lower priority vs the other enhancements currently inflight.

onsi avatar Sep 19 '22 17:09 onsi

Thanks for the reply, I'll close the thread for now

felipe88alves avatar Sep 22 '22 10:09 felipe88alves