Skip to content

Feature: assert.Consistently #1087

@shaneutt

Description

@shaneutt

I've been using testify for a long time now, I appreciate you building and maintaining this for us all 🙇

I'm looking for functionality that is inspired by other testing frameworks that would be similar to assert.Eventually and require.Eventually, but instead would be:

stagger := time.Millisecond * 200
tries := 15
assert.Consistently(t, func() bool {
   fmt.Println("my logic here")
   return result()
}, stagger, tries)

The point of this would be to ensure that a result is consistently occurring over a period of time. In the above example, that the fake result() function is returning true consistently every 200ms for 3 seconds total.

Does testify already have something like this and I've just missed it?

If not, are you cool with me contributing something like this?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions