I have handlers for unhandledRejections and uncaughtExceptions:
unhandledRejection
uncaughtException
bin.js
[\'unhandledRejection\', \'uncaughtExce
putting it inside try catch will help:
const error = new Error('mock error');
try {
await Promise.reject(error);
} catch(error){
expect(logger.error).toHaveBeenCalledWith(error);
}