diff --git a/src/test_utils.rs b/src/test_utils.rs index 305643f0f..3e95b81f2 100644 --- a/src/test_utils.rs +++ b/src/test_utils.rs @@ -856,6 +856,11 @@ impl EventTracker { }) .await } + + /// Consumes all pending events. + pub async fn consume_events(&self) { + while self.try_recv().is_ok() {} + } } /// Gets a specific message from a chat and asserts that the chat has a specific length.