Testing Asynchronous Services
Learn how to test asynchronous services using the waitForAsync and fakeAsync artifacts.
We'll cover the following...
We'll cover the following...
Angular testing utilities
Angular testing utilities provide two artifacts to tackle asynchronous testing scenarios:
waitForAsync
: An asynchronous approach to unit test asynchronous services. It is combined with thewhenStable
method ofComponentFixture
.fakeAsync
: A synchronous approach to unit test asynchronous services. It is used in combination with thetick
function.
Both approaches provide roughly the same functionality; they only differ ...