stretchr / testify

A toolkit with common assertions and mocks that plays nicely with the standard library
MIT License
23.53k stars 1.6k forks source link

`Eventually` functions documentation is misleading as waitFor and tick are swapped in the example #1677

Closed delca85 closed 3 days ago

delca85 commented 1 week ago

Description

Documentation of EventuallyWithT and EventuallyWithTf functions (in both require or assert package) is misleading, as the sample code swaps waitFor and tick args in the call.

Step To Reproduce

Go to assert.EventuallyWithT docs and look at the example, it shows 1*time.Second, that is supposed to be the tick as 1st argument that should be waitFor. Same thing for assert.EventuallyWithTf, require.EventuallyWithT and require.EventuallyWithTf.

ChinoUkaegbu commented 1 week ago

Hi, I'd like to work on this! What file(s) should be edited? This search query shows five files but I'm unsure if they all should be edited especially since some of them have a comment at the top to not edit --> // Code generated with github.com/stretchr/testify/_codegen; DO NOT EDIT.

brackendawson commented 1 week ago

Only edit files without the DO NOT EDIT header. To change the rest you run go generate ./....

brackendawson commented 3 days ago

Thanks for your efforts, however I now see this was actually fixed in #1588 but that hasn't been released yet.

I do plan to make a v1.10.0 release soon. I have an ordered list of testify tasks for me to do and making the release is currently second on that list.