testify
testify copied to clipboard
Add func similar to `AssertExpectations` which does not fail the test
Description
Out test suite uses AssertExpectations(t TestingT) bool which is great to ensure that all expected calls have been met.
It has a small issue though when working with eventually consistent code (like Kubernetes controllers): one cannot use it to wait for the expectations to get fulfilled because it fails the test.
Proposed solution
Add CheckExpectations() bool or CheckExpectations(t TestingT) bool which will not fail the test when some expectations where not met. This will allow callers to use e.g. require.Eventually() / require.EventuallyWithT() with that newly added function.
Use case
AssertExpectations() with eventually consistent code.