• Overview
@angular/core/testing

flush

function
stable

IMPORTANT: This API requires Zone.j

API

function flush(maxTurns?: number | undefined): number;

flush

number

IMPORTANT: This API requires Zone.j

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.

@parammaxTurnsnumber | undefined

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

@returnsnumber

Description

IMPORTANT: This API requires Zone.j

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.

Jump to details