testify
testify copied to clipboard
feat: add assert.Consistently
Summary
This changeset adds the assert.Consistently
and it's associated functions to assert that a condition is true over the entire period of waitFor
. This is useful when testing the behavior of asynchronous functions.
Changes
-
assert.Consistently
checks that a provided function is true for the entirety ofwaitFor
-
assert.Consistentlyf
checks that a provided function is true for the entirety ofwaitFor
and allows for formatting the error message -
assert.ConsistentlyWithT
checks that a provided function that accepts atesting.T
is true for the entirety ofwaitFor
-
assert.ConsistentlyWithTf
checks that a provided function that accepts atesting.T
is true for the entirety ofwaitFor
and allows for formatting the error message
Motivation
See: https://github.com/stretchr/testify/issues/1087#issuecomment-2139222285
Related issues
Closes https://github.com/stretchr/testify/issues/1087