Reputation: 31
I am using the mocha root hook plugin as this piece of code:
exports.mochaHooks = {
beforeEach(done) {
some code
done();
},
};
But now I need to await an async function inside the beforeEach block. How can I do this?
Upvotes: 3
Views: 371
Reputation: 15215
The syntaxis is as follow:
beforeEach(async () => {
await doSomething()
})
Upvotes: 1