1beforeAll(async (done) => {
2 // ALWAYS TRY - CATCH
3 // If you don't use try-catch, the function will run forever
4 try {
5 await task()
6
7 done()
8 } catch (e) {
9 console.error(e)
10 /**
11 * Add timeout because jest does not show the error
12 * when exiting
13 */
14 await new Promise((resolve) => setTimeout(resolve, 500))
15
16 process.exit(0)
17 }
18})