fake_async
fake_async copied to clipboard
Add option to automatically progress microtasks.
If autoMicrotasks
is set to true
when creating FakeAsync
or calling fakeAsync
, the microtask
queue will automatically be flushed by a microtask from the parent zone.
For tests that only care about larger-grained timers, this can make it easier to ensure progress for intermediate computations.
Also binds timer and microtask callbacks in their originating zone, to ensure they are run there, and that unhandled errors get reported in that zone.
(I looked at the issues, and a lot of them seem to come back to someone not progressing microtasks enough. Could this approach be a way to ensure some progress for tests that only really care about the big timer-steps? Maybe it'll just move the same issues further up the event stack.)