Jest hangs on last test suite constantly
See original GitHub issue🐛 Bug Report
Jest is hanging constantly on last test suite runs. Every time the last test suite is different. I have tried with runInBand
options but no luck.
I got some luck after running node_modules/.bin/jest --clearCache
then node_modules/.bin/jest
now works mostly. But still, it’s not stable enough.
"scripts": { "test": "jest --clearCache && jest --silent" }
I have installed watchman via homebrew also as pointed out on other issues but no luck. Could please help us to fix the issue. Please let me know if any information is needed.
Environment Information:
System:
OS: macOS Sierra 10.12.6
CPU: x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Binaries:
Node: 6.11.1 - ~/.nvm/versions/node/v6.11.1/bin/node
npm: 5.3.0 - ~/.nvm/versions/node/v6.11.1/bin/npm
npmPackages:
jest: ^23.4.1 => 23.4.1
Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top Results From Across the Web
node.js - jest hangs indefinitely, runs no tests - Stack Overflow
Most of my test where running but one suite was continuously running and never erroring. It turned out I had a race condition...
Read more >Why Jest freezes after tests run? (Jest hangs indefinitely)
If you noticed that Jest (npm / yarn) test hang at the end of the test execution while you run tests in parallel...
Read more >How to Stop Jest Tests from Hanging in Angular | by Paul Kim
Jest test hangs, hanging, stuck, never finishes, not running, won't stop. An article to stop hanging Jest tests in an Angular project.
Read more >Jest / npm / yarn test hang at the end of the test (e.g. at Ran all ...
Note: This feature is an escape-hatch. If Jest doesn't exit at the end of a test run, it means external resources are still...
Read more >Runner hangs sometimes after all Jest tests are completed
I use GitLab cloud CI to run Jest tests on my node project and after deploy the app to AWS. It happened now...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have a completely trivial test like the following:
Even if I explicitly finish the test with
done
, it just spins forever:Most likely because
something()
never resolves - but the test never times out, so my only option is CTRL+C, which doesn’t tell me where it was or what it was doing.Why doesn’t it respect the timeout?
How do you diagnose something like this?
@laumair There is no issue with jest, I have fixed this issue by modifing my tests code. I faced this issue when I migrated from mocha to jest. One notable issue is that we need to call ‘done’ callback properly if test is asynchronous.
For example, Test might completed before our asynchronous function call gets completed. Those asynchronous call might be the problem.