Question 8 of 10Pro Only
How do you test asynchronous code in backend applications?
Sample answer preview
Testing asynchronous code requires special handling because assertions must wait for async operations to complete. With async/await syntax in modern JavaScript, testing is straightforward. Make the test function async and await the code under test.
asyncawaitdonepromisetimeoutfake timers