How can the 'done' callback be used in asynchronous testing with Mocha?

  • done is used to terminate the Mocha test suite prematurely.
  • done is used to indicate that the test is asynchronous and should wait for it to complete.
  • done is used to skip a test case in Mocha.
  • done is not used in Mocha for asynchronous testing.
In Mocha, the done callback is used to indicate that a test is asynchronous and should wait for it to complete before considering the test case finished. It prevents the test case from finishing prematurely. The other options provide incorrect information about the use of done.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *