Test the Hidden Promise Using Done or Await
Explore how to test asynchronous JavaScript functions that use hidden Promises in Jasmine. Understand how to use the done callback and async/await for robust unit tests, including handling success and error cases in API calls.
In everyday work, we often need to deal with Promises (MDN article). If the function we test is async (it returns a Promise), we can use async and await in our tests.
When the ...