I am writing a timer app. In unit testing how do I wait for few seconds to test if my timer is working properly?
// I want something like this.
test("Testing timer", () {
int startTime = timer.seconds;
timer.start();
// do something to wait for 2 seconds
expect(timer.seconds, startTime - 2);
});