Testing with Async/Await
Learn how to use Jest to test asynchronous code with async/await syntax.
We'll cover the following...
Using async/await
The most modern handling of asynchronous code in JavaScript uses the async
and await
keywords. It doesn’t replace promises per se, but it is the syntactic sugar while working with promises.
With async/await
, we mark a function as being asynchronous with the async
keyword, which then allows us to await
the completion ...