jest beforeall error
beforeAll(async (done) => {
// ALWAYS TRY - CATCH
// If you don't use try-catch, the function will run forever
try {
await task()
done()
} catch (e) {
console.error(e)
/**
* Add timeout because jest does not show the error
* when exiting
*/
await new Promise((resolve) => setTimeout(resolve, 500))
process.exit(0)
}
})