Mocha async test timeouts: distinguishing late rejections from hanging promises
Mocha enforces a timeout on every test, with a default of 2000 ms, and the timer starts when the test function is invoked. For async tests, the setting applies to the entire body, so a returned promise that never settles is aborted with a timeout error once the deadline passes. The unresolved behavior concerns promises that do settle, but only after the dead