vendredi 7 juin 2019

What is the difference between tick() and flush() in angular testing?

On the angular documentation I see these two functions, tick() and flush(). Both of these seem to do similar things. From the angular documentation, it says for tick:

Simulates the asynchronous passage of time for the timers in the fakeAsync zone.

and for flush:

Simulates the asynchronous passage of time for the timers in the fakeAsync zone by draining the macrotask queue until it is empty. The returned value is the milliseconds of time that would have been elapsed.

Can anyone explain the difference to me?

Aucun commentaire:

Enregistrer un commentaire