Skip to content

Commit 09b9a68

Browse files
committed
wip awaitFakeAsync still catch pending timers; give nice output
1 parent 1092f6f commit 09b9a68

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/fake_async.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ T awaitFakeAsync<T>(Future<T> Function(FakeAsync async) callback,
4242
'did not complete within timeout $timeout.');
4343
} else if (error != null) {
4444
Error.throwWithStackTrace(error!, stackTrace!);
45+
} else if (async.pendingTimers.isNotEmpty) {
46+
throw TimeoutException(
47+
'At expiry of timeout $timeout there were ${async.pendingTimers.length} pending timers:\n\n'
48+
'${async.pendingTimers.map((timer) => timer.debugString).join('\n')}');
4549
} else {
4650
return value;
4751
}

0 commit comments

Comments
 (0)