Lesson

When to use async / await vs waitForAsync in Angular tests

Angular has various ways to handle asynchronous scenarios when testing your code (be it with Karma or Jest).

Duration
3 min
Access
Pro
Transcript
Available

Angular has various ways to handle asynchronous scenarios when testing your code (be it with Karma or Jest).

In this lesson we are specifically looking at the deprecated "async" exported from "@angular/core/testing", which has been replaced by the waitForAsync. Given that, one might also wonder, why not use the async/await statement that is native to Angular. Let's explore!