Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions assert/assertion_format.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,11 @@ func Eventuallyf(t TestingT, condition func() bool, waitFor time.Duration, tick
// }()
// assert.EventuallyWithTf(t, func(c *assert.CollectT) {
// // add assertions as needed; any assertion failure will fail the current tick
// assert.True(c, externalValue, "expected 'externalValue' to be true")
// }, 10*time.Second, 1*time.Second, "error message %s", "formatted")
// assert.True(c, externalValue)
// }, 10*time.Second, 1*time.Second, "externalValue was not true before timeout")
//
// The msg and args format the failure when the condition is never met; they are
// not passed to the condition callback.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change must be applied on assertions.go, and then run go generate github.com/stretchr/testify/... to regenerate dependents.

func EventuallyWithTf(t TestingT, condition func(collect *CollectT), waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
Expand Down
7 changes: 5 additions & 2 deletions assert/assertion_forward.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,11 @@ func (a *Assertions) EventuallyWithT(condition func(collect *CollectT), waitFor
// }()
// a.EventuallyWithTf(func(c *assert.CollectT) {
// // add assertions as needed; any assertion failure will fail the current tick
// assert.True(c, externalValue, "expected 'externalValue' to be true")
// }, 10*time.Second, 1*time.Second, "error message %s", "formatted")
// assert.True(c, externalValue)
// }, 10*time.Second, 1*time.Second, "externalValue was not true before timeout")
//
// The msg and args format the failure when the condition is never met; they are
// not passed to the condition callback.
func (a *Assertions) EventuallyWithTf(condition func(collect *CollectT), waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
Expand Down
7 changes: 5 additions & 2 deletions require/require.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,11 @@ func EventuallyWithT(t TestingT, condition func(collect *assert.CollectT), waitF
// }()
// require.EventuallyWithTf(t, func(c *assert.CollectT) {
// // add assertions as needed; any assertion failure will fail the current tick
// require.True(c, externalValue, "expected 'externalValue' to be true")
// }, 10*time.Second, 1*time.Second, "error message %s", "formatted")
// require.True(c, externalValue)
// }, 10*time.Second, 1*time.Second, "externalValue was not true before timeout")
//
// The msg and args format the failure when the condition is never met; they are
// not passed to the condition callback.
func EventuallyWithTf(t TestingT, condition func(collect *assert.CollectT), waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
Expand Down
7 changes: 5 additions & 2 deletions require/require_forward.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,11 @@ func (a *Assertions) EventuallyWithT(condition func(collect *assert.CollectT), w
// }()
// a.EventuallyWithTf(func(c *assert.CollectT) {
// // add assertions as needed; any assertion failure will fail the current tick
// assert.True(c, externalValue, "expected 'externalValue' to be true")
// }, 10*time.Second, 1*time.Second, "error message %s", "formatted")
// assert.True(c, externalValue)
// }, 10*time.Second, 1*time.Second, "externalValue was not true before timeout")
//
// The msg and args format the failure when the condition is never met; they are
// not passed to the condition callback.
func (a *Assertions) EventuallyWithTf(condition func(collect *assert.CollectT), waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
Expand Down
Loading