To fix the For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves error with Jest and JavaScript, we should make sure we use await with promises.
For instance, we write
it("assertion success", async () => {
const result = await resolvingPromise;
expect(result).to.equal("promise resolved");
});
to use await to get the resolved value of the resolvingPromise promise.
Then we check the resolve value of the promise with expect and to.equal.