Is there a way to assert the number of checks done? #769
Unanswered
thejohnfreeman
asked this question in
Q&A
Replies: 2 comments
-
Perhaps you could hack your way around and expose Perhaps you could hack it similarly to this: #345 (comment) |
Beta Was this translation helpful? Give feedback.
0 replies
-
I have had experience with similar scenarios in which the testable component is within a callback which is called N many times. The preferred route I had was to instead aggregate results into a collection, and perform the assertions on that instead. That way, if the callback is inadvertently run or less than expected, you can check this using a pretty standard mechanism. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to test some async code that uses callbacks. I have
CHECK
s in my callback. I don't want my test to trivially pass because the callback was never called. At the end of my test, I want to assert that a specific or minimum number of checks were done. Is that possible in the current framework, or is this a feature request? I'll open an issue if it's a request. Thank you!Beta Was this translation helpful? Give feedback.
All reactions