flush
function
Flushes any pending microtasks and simulates the asynchronous passage of time for the timers in
the fakeAsync
zone by
draining the macrotask queue until it is empty.
API
function flush( maxTurns?: number | undefined): number;
flush
number
Flushes any pending microtasks and simulates the asynchronous passage of time for the timers in
the fakeAsync
zone by
draining the macrotask queue until it is empty.
@parammaxTurns
number | undefined
The maximum number of times the scheduler attempts to clear its queue before throwing an error.
@returns
number
Jump to details