146
147
// Await calls fn repeatedly until all assertions pass or timeout is reached.
148
>
func (s *Suite[T]) Await(fn func(T), timeout, interval time.Duration) {
suite.go
149
>
s.Awaitf(fn, timeout, interval, "")
150
>
}
151
152
// Awaitf is like [Await] but includes a format string appended to the failure message.
153
>
func (s *Suite[T]) Awaitf(fn func(T), timeout, interval time.Duration, msg string, args ...any) {
suite.go
154
>
t := s.T()
155
>
await.Requiref(s.Context(), t, func(at *await.T) {
156
>
fn(s.copySuite(t, false, at, at.Context()).(T))
157
>
}, timeout, interval, msg, args...)
158
}
159