Getting a UnhandledPromiseRejectionWarning when testing using mocha/chai
The issue is caused by this: If the assertion fails, it will throw an error. This error will cause done() never to get called, because the code errored out before it. That’s what causes the timeout. The “Unhandled promise rejection” is also caused by the failed assertion, because if an error is thrown in a … Read more