jest beforeall error

Solutions on MaxInterview for jest beforeall error by the best coders in the world

showing results for - "jest beforeall error"
Minerva
24 Jun 2019
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})