MCPcopy
hub / github.com/stretchr/testify / EventuallyWithT

Function EventuallyWithT

require/require.go:436–444  ·  view source on GitHub ↗

EventuallyWithT asserts that given condition will be met in waitFor time, periodically checking target function each tick. In contrast to Eventually, it supplies a CollectT to the condition function, so that the condition function can use the CollectT to call other assertions. The condition is consi

(t TestingT, condition func(collect *assert.CollectT), waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

434// require.True(c, externalValue, "expected 'externalValue' to be true")
435// }, 10*time.Second, 1*time.Second, "external state has not changed to 'true'; still false")
436func EventuallyWithT(t TestingT, condition func(collect *assert.CollectT), waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) {
437 if h, ok := t.(tHelper); ok {
438 h.Helper()
439 }
440 if assert.EventuallyWithT(t, condition, waitFor, tick, msgAndArgs...) {
441 return
442 }
443 t.FailNow()
444}
445
446// EventuallyWithTf asserts that given condition will be met in waitFor time,
447// periodically checking target function each tick. In contrast to Eventually,

Callers 3

EventuallyWithTMethod · 0.70
TestEventuallyWithTFalseFunction · 0.70
TestEventuallyWithTTrueFunction · 0.70

Calls 3

EventuallyWithTFunction · 0.92
HelperMethod · 0.65
FailNowMethod · 0.65

Tested by 2

TestEventuallyWithTFalseFunction · 0.56
TestEventuallyWithTTrueFunction · 0.56