expectErrorCount static method
Verify that a specific number of errors were logged
Implementation
static void expectErrorCount(
int expectedCount,
void Function() test,
) {
int errorCount = 0;
withErrorLogger(
(error) => errorCount++,
test,
);
if (errorCount != expectedCount) {
throw Exception('Expected $expectedCount errors but got $errorCount');
}
}