W3cubDocs

/Angular 12

flush

function

Simulates the asynchronous passage of time for the timers in the fakeAsync zone by draining the macrotask queue until it is empty.

flush(maxTurns?: number): number

Parameters
maxTurns number

The maximum number of times the scheduler attempts to clear its queue before throwing an error.

Optional. Default is undefined.

Returns

number: The simulated time elapsed, in milliseconds.

© 2010–2021 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v12.angular.io/api/core/testing/flush