fakeAsync
function
stable
IMPORTANT: This API requires Zone.js and cannot be used with the Vitest test runner
Description
IMPORTANT: This API requires Zone.js and cannot be used with the Vitest test runner
Wraps a function to be executed in the fakeAsync zone:
- Microtasks are manually executed by calling
flushMicrotasks(). - Timers are synchronous;
tick()simulates the asynchronous passage of time.
Can be used to wrap inject() calls.
Jump to details