I am trying to use FakeAsync from Dart quiver library to mock the clock of a CountDownTimer.
However, when I await any async function inside the run method, it hangs.
testWidgets('Resend OTP', (WidgetTester tester) async {
await FakeAsync().run((async) async {
final countDownTimer = new CountdownTimer(
new Duration(seconds: 30),
new Duration(seconds: 1),
stopwatch: FakeStopwatch(
() => async.getClock(DateTime.fromMillisecondsSinceEpoch(0)).now().millisecondsSinceEpoch, 1000),
);
print(countDownTimer.remaining);
print(countDownTimer.isRunning);
await tester.pumpWidget(Container());
});
});