-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Timeout of 2000ms exceeded #2958
Comments
If it is expected/acceptable for your test to take longer than the timeout specified in the error message, you can override the amount of time for the timeout using P.S. You can remove |
Facing the same issue when using
|
@Jo-ravar I can't really debug that since I don't have your |
Here is the simplified version of code
The only thing causing issue is the first line here whenever I am loading the server or Note :---
|
I'm still not seeing the code for the |
@Jo-ravar How much timeout did you set? I was testing one upload function, and it depended on size of file I was trying to upload. So, sometimes it didn't give me error on 10 seconds, while for some uploads it even gave me failures for 45 second timeout. |
@Jo-ravar i am too getting the same error , have you found the solution? |
Any resolution on this? |
This needs an mcve; I don't believe it's a Mocha problem anyway. Re-open if someone can confirm. |
I have found the solution for my case here #2025 |
For the people who still struggling with this problem, just add
|
You can may also try to run the code last. I had the same issue but was able to by pass it using: |
go here https://mochajs.org/#timeouts |
Hey, guys, I was running through the same error. after carefully searching I found out I need to call the "done()" function. It was given some trouble but now it passes the test. describe('sample_tests', function () { |
describe('a suite of 7 seconds', function () {
this.timeout(7500);
it('should take less than 5s', function (done) {
setTimeout(done, 5000);
});
it('should take less than 2s as well', function (done) {
setTimeout(done, 2000);
});
}); More info: 👉 https://mochajs.org/#timeouts |
I am also having the same error. Can anybody help me? This is my code: import mongoose from 'mongoose' dotenv.config() describe ('AuthRepository', () => {
}) |
I used it solve my question. just add a line |
I have the same problems, I also need to rewrite the anonymous arrow function to normal function. However, I still got the following errors.
|
When I try to use promises with mocha, I'm getting the error below:
Actually, I'm trying to retireve data from a remote server. Mocha won't wait until the promise has been resolved or rejected.
After 2 seconds, this error occurs.
I've been planning to check the returning data within then and call the assert.
What am I doing wrong? I want to check the returning data if it has proper keys, etc.
The text was updated successfully, but these errors were encountered: