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.
About Volare Systems
We build high quality web and mobile apps that run fast and look great on every device . We are based in Denver, Colorado . Let us know if we can help your company with custom software development or custom application development.
We hope this blog post was helpful . If so, please share it using the social toolbar on this page so others can find it. Thank you .