await calls in tests. This is a big help in cleaning up tests where you previously had to put asserts in a
I’ve written before about how you can use Jasmine’s done keyword to test async specs, but here’s a quick recap. You pass in a special Jasmine
done parameter, then you invoke the
done() function after your async code has completed, usually inside a
.then() or a
.catch() statement, like this.
With version 2.8 and later of Jasmine and your compiler that supports async/await (e.g., Babel, TypeScript), you can change this to be more readable, like this.