Exceeded timeout of 5000 ms for a test

See original GitHub issue

I am upgrading jest from v1.4.3 --> 2+, with chromedriver version 91+. I have started getting this issue:

thrown: "Exceeded timeout of 5000 ms for a test. Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

I have been googling a lot but not getting proper solution. So, far I have tried following solutions:- 1)Increased jest.setTimeout(30000) from 30000 to 60000. 2)Tried using jest- testRunner": “jest-circus/runner”

My package.json configuration is as below: “@types/jest”: “26.0.23”, “@types/node”: “15.12.4”, “@types/selenium-webdriver”: “4.0.14”, “chromedriver”: “91.0.1”, “concurrently”: “6.2.0”, “jest”: “27.0.5”, “prettier”: “2.3.1”, “selenium-webdriver”: “4.0.0-alpha.7”, “ts-jest”: “27.0.3”, “tslint”: “6.1.3”, “tslint-config-prettier”: “^1.15.0”, “tslint-config-sparta”: “0.3.4”, “tslint-loader”: “3.5.4”, “typedoc”: “0.21.0”, “typescript”: “3.9.7”, “ui-testing-core”: “0.15.12”

Can anybody point out what is the solution?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:38
  • Comments:55 (2 by maintainers)

github_iconTop GitHub Comments

39reactions
izhaoqingcommented, Aug 17, 2021
// jest.config.js
module.exports = {
    // ...
    testTimeout: 20000
}

It seems to solve the problem.

36reactions
vdanylovcommented, Jul 9, 2021

Same problem, some solution is to add: jest.useFakeTimers(‘legacy’)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Message "Async callback was not invoked within the 5000 ms ...
The default timeout value is 5000 (5000 ms - 5 seconds). This will be applicable for all test cases. Or if you want...
Read more >
Unable to test my API with Jest : r/node - Reddit
I am new to automated testing and I am trying to test my api with jest library. ... thrown: "Exceeded timeout of 5000...
Read more >
Jest test setTimeout and Promise - remarkablemark
thrown: "Exceeded timeout of 5000 ms for a test. Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running ...
Read more >
thrown: "exceeded timeout of 5000 ms for a hook. use jest ...
thrown: "exceeded timeout of 5000 ms for a hook. use jest.settimeout(newtimeout) to increase the timeout value, if this is a long-running test.".
Read more >
jest.setTimeout JavaScript and Node.js code examples
set jest timeout to very long, because these take a while beforeAll(() => jest. ... timeout interval for tests and before/after hooks in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found