Jest stops working after too many restarts
See original GitHub issueEnvironment
-
node -v
: [8.9.0] -
npm -v
: [5.4.2] -
Operating system: [macOS v10.12.5]
Steps to Reproduce
Install Jest extension Restart VS Code
Expected Behavior
Jest extension runs without error
Actual Behavior
Jest extension errors after multiple attempts at running Task bar says "Jest: stopped (too many restarts)
Jest OUTPUT
Error in console
Package.json scripts:
"scripts": {
"start": "concurrently --kill-others \"better-npm-run start-prod\" \"npm run start-api\"",
"test": "jest",
"updateSnapshots": "jest --updateSnapshot",
"test-watch": "jest --watch",
},
Let me know if you need any further info
Thanks,
Owen
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
node.js - jest hangs indefinitely, runs no tests - Stack Overflow
This happens to me too but it's intermittent, very frustrating though. I have discovered a workaround which is to run using the --runInBand...
Read more >Jest CLI Options
Force Jest to exit after all tests have completed running. This is useful when resources set up by test code cannot be adequately...
Read more >Unit Testing with Jest | CS4530, Spring 2022
If restarting Jest does not work, you can run the following in your VSCode by opening VSCode's command palette ( Ctrl + Shift...
Read more >Fix 'EMFILE: too many open files' error in Jest - SeanMcP.com
When trying to run Jest in watch mode, this error may mean that you are missing a dependency.
Read more >How to make your sluggish Jest tests go faster - ITNEXT
Jest v23 has performance issues. When running in watch mode it takes an enormous amount of time for Jest to update, it's easier...
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
Installing watchman fixed this issue for me:
brew update
brew install watchman
Then reload the Jest plugin
While trying to create a test-case I managed to figure it out (@seanpoulter thanks for your question)!
The problem was caused by me installing
ts-jest
via bash terminal (WLS) instead of using CMD Terminal. As the result it’s dependency cpx was not compiled correctly - there was nocpx.cmd' inside the
node_modules/.bin/` directory.I managed to fix the problem by deleting the
node_modules
directory and doingnpm install
from CMD/DOS terminal. That re-installed and compiled correctly all the modules.It’s probably safest option to always install all the modules from CMD/DOS terminal. That way they will work both in in bash and cmd terminal!