flushMicrotasks method

void flushMicrotasks()

Runs all pending microtasks scheduled within a call to run or fakeAsync until there are no more microtasks scheduled.

Does not run timers.

Implementation

void flushMicrotasks() {
  while (_microtasks.isNotEmpty) {
    _microtasks.removeFirst()();
  }
}