I'm encountering this very popular issue, there were many solutions out there but none of them worked for me.
I get this error: Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
Here is my code:
describe('POST before and afterSave("ticket")', () => {
it('should save ticket credentials correctly', () => {
// console.log(ticket);
ticket.set("status", "pending");
return ticket.save(null, { useMasterKey: true
}).then(function(object) {
console.log("hi2");
expect(object).toExist();
})
.catch((error) => {
console.log("hi3");
});
});
});