Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
connectdotz opened this issue Jan 2, 2020 · 6 comments

Comments

@connectdotz
Copy link
Collaborator

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

@josias-r
Copy link

josias-r commented Jan 8, 2020

+1
Yep, without the folder name in which it failed, it's quite hard to detect which folder has a problem in a workspace with multiple projects

@JosNun
Copy link

JosNun commented 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.

@chrisnurse
Copy link

I also have a workspace with multiple projects, and running VSCODE from within the project folder, in which my test folder is found, all works fine. However, if I open VSCODE at the workspace folder level the test explorer fails to find the tests in the project contained in my project's sub-folder.

@connectdotz connectdotz mentioned this issue Apr 29, 2020
15 tasks
@seanpoulter seanpoulter added this to the v4.0 milestone May 2, 2020
@sin-ko
Copy link

sin-ko commented 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"

@bryanjnelson
Copy link

I'm having the same problem, but without the disabledWorkspaceFolder description:

Test Suites: 44 passed, 44 total
Tests: 79 passed, 79 total
Snapshots: 14 passed, 14 total
Time: 22.442s
Ran all test suites.

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

Can anyone recommend any troubleshooting for that?

@connectdotz
Copy link
Collaborator Author

closed via v4 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants