Testing with Promises

Learn how to use Jest to test asynchronous code with promises.

We'll cover the following...

Using promises

Promises are an alternative to using callbacks in JavaScript. They are at the core of modern JavaScript asynchronous code. A promise is an object that represents the completion of asynchronous code. Once created, the promise is pending and ultimately either moves into a state of being resolved or rejected, depending on whether or not the asynchronous code was ...