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.

"Starting Jest in Watch mode failed too many times" helper is not very helpful

See original GitHub issue

Environment

  1. node -v: 12.9.1

  2. yarn -v: 1.21.1

  3. npm ls jest or npm ls react-scripts (if you haven’t ejected): react-scripts@3.3.0

  4. your vscode-jest settings if customized:

    • jest.pathToJest? yarn test
  5. Operating system: macOS 10.15.2

Prerequisite

  • are you able to run jest test from command line? yes
  • how do you run your tests from command line? (for example: npm run test or node_modules/.bin/jest) yarn test

Steps to Reproduce

  • create a workspace with multiple folders
  • add a folder (folder-1) without any test, in package.json add a test script with --passWithNoTests, vscode-jest will still consider jest failed.
  • add another folder (folder-2) without any test, in package.json, add a test script with "test": echo "no test yet"

Relevant Debug Info

from folder-1 output channel:

Done in 0.93s.

Starting Jest in Watch mode failed too many times and has been stopped.
Consider add this workspace folder to disabledWorkspaceFolders
 see troubleshooting: https://github.com/jest-community/vscode-jest/blob/master/README.md#troubleshooting

from folder-2 output channel:

yarn run v1.21.1

$ echo 'test not yet implemented' --testLocationInResults --json --useStderr --outputFile /var/folders/vg/yw9mltwd1mj_29xbvhwywc980000gn/T/jest_runner_core.json --watch --no-coverage --no-color --reporters default --reporters /Users/xxx/.vscode/extensions/orta.vscode-jest-3.1.0/out/reporter.js

test not yet implemented --testLocationInResults --json --useStderr --outputFile /var/folders/vg/yw9mltwd1mj_29xbvhwywc980000gn/T/jest_runner_core.json --watch --no-coverage --no-color --reporters default --reporters /Users/xxx/.vscode/extensions/orta.vscode-jest-3.1.0/out/reporter.js

Done in 0.06s.

Starting Jest in Watch mode failed too many times and has been stopped.
Consider add this workspace folder to disabledWorkspaceFolders
 see troubleshooting: https://github.com/jest-community/vscode-jest/blob/master/README.md#troubleshooting

Expected Behavior

  • folder-1 output channel has wiped out the actual command executed
  • it should not report jest test failure
  • if it must, at least show which folder is failed in the helper popup
  • our troubleshooting section should be revamped to provide better self-help instructions…

Actual Behavior

right now all failures in a workspace env suggest users to “disableWorkspaceFolders”, which is not always helpful


The fastest (and the most fun) way to resolve the issue is to submit a pull-request yourself. If you are interested, feel free to check out the contribution guide, we look forward to seeing your PR…

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:17
  • Comments:6

github_iconTop GitHub Comments

8reactions
sin-kocommented, Jul 25, 2020

you could also, as a work around, modify pathToJest to source which version of node first

// in your workspace setting
"jest.pathToJest": "PATH=/Path/to/your/Node/bin/:$PATH yarn test"
1reaction
JosNuncommented, Jan 18, 2020

I had the same issue, and my problem ended up being that I was using nvm, so the plugin couldn’t find node.

My solution ended up being installing node using one of the recommended installers.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix 'EMFILE: too many open files' error in Jest
When trying to run Jest in watch mode, this error may mean that you are missing a dependency.
Read more >
Starting Jest in Watch mode error and missing Debug link ...
Error Starting Jest in Watch mode failed too many times and has been stopped. Things I tried: Using the Help link. This leads...
Read more >
Configuring Jest
Configuring Jest. The Jest philosophy is to work great by default, but sometimes you just need more configuration power.
Read more >
vscode-jest - Visual Studio Marketplace
How to trigger the test run? By default, the extension uses jest watch mode that automatically runs tests upon related file changes. In...
Read more >
Frontend testing standards and style guidelines - GitLab Docs
Running yarn jest-debug runs Jest in debug mode, allowing you to debug/inspect as described in the Jest docs. ... If your test exceeds...
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