question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Jest stops working after too many restarts

See original GitHub issue

Environment

  1. node -v: [8.9.0]

  2. npm -v: [5.4.2]

  3. 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 image

Error in console image

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:closed
  • Created 6 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
myatt95commented, Jun 14, 2018

Installing watchman fixed this issue for me: brew update brew install watchman

Then reload the Jest plugin

2reactions
knee-colacommented, Nov 29, 2017

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 no cpx.cmd' inside the node_modules/.bin/` directory.

I managed to fix the problem by deleting the node_modules directory and doing npm 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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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