serverless-mocha-plugin
serverless-mocha-plugin copied to clipboard
Error: Timeout of Xms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
Hi guys, I need help please. I am trying to do a simple test with timeout of 30000ms, but I don't know why throw this error: Error: Timeout of 30000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
describe('describe 1', function () {
it('test 1', function (done) {
expect(200).to.be.equal(200);
done;
}).timeout(30000);
});
Thanks!
Make sure you have v1.10.0 minimum.
Then you can use the --timeout
option. E.g. sls invoke test --timeout 10000
for 10000ms.
describe('describe 1', function () { it('test 1', function (done) { expect(200).to.be.equal(200); done; }).timeout(30000); });
Replace done;
with done();
. You need to call the function.