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

Warnings box the show "(frontend) Failed to obtain test file list, something might not be setup right?" for each of the folders of the workspace #695

Closed
bodote opened this issue May 10, 2021 · 3 comments

Comments

@bodote
Copy link

bodote commented May 10, 2021

Environment

  1. vscode-jest version: [4.0.0]
  2. node -v: [v15.14.0]
  3. npm -v or yarn --version: [7.7.6]
  4. npm ls jest or npm ls react-scripts :
my-frontend@1.41.0-4 /Users/my.name/dev/workspace2/myproject/frontend
├─┬ @angular-builders/jest@11.0.0
│ └── jest@26.6.3 deduped
├─┬ jest-cucumber@3.0.1
│ └── jest@26.6.3 deduped
├─┬ jest-preset-angular@8.3.2
│ └── jest@26.6.3 deduped
├── jest@26.6.3
└─┬ ts-jest@26.4.4
  └── jest@26.6.3 deduped]
  1. your vscode-jest settings if customized:
    • jest.jestCommandLine? [ng test --runInBand --]
    • jest.autoRun? [not set]
    • anything else that you think might be relevant? [yes: workspace has also some non-angular/non-jest folders]
  2. Operating system: [Big Sur 11.3 (20E232) (M1)]

Prerequisite

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

Steps to Reproduce

create 2 folders , one with and one without a angular/jest project
open one folder, add the other one to the workspace , save the workspace in vscode with "file->save workspace"
close the workspace and open the same workspace again.

Relevant Debug Info

  • brew install watchman because of Error: Error watching file for changes: EMFILE #76
  • moreover : for all the workspace folder , where I do NOT want to run jest I have added
    .vscode/settings.json:
    {
    "jest.autoRun": "off"
    }
    because otherwise I would get even another error message on vscode start or opening workspace :
    "(vscode-test2) Jest process "watch-tests" failed unexpectedly"

Expected Behavior

not showing all the Warning boxes that say "(frontend) Failed to obtain test file list, something might not be setup right?" for each of the folders of the workspace

Actual Behavior

showing one the Warnings box the show "(frontend) Failed to obtain test file list, something might not be setup right?" for each of the folders of the workspace


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

@connectdotz
Copy link
Collaborator

@bodote sorry about this issue, a few questions to help us diagnose:

  • are you seeing the warning/error panel on the folder you do want to run jest?
  • for the folders you don't want to run jest, you could use jest. disabledWorkspaceFolders
  • is this a new repo? If not, did it work with the previous version (3.2.0)?

@bodote
Copy link
Author

bodote commented May 11, 2021

are you seeing the warning/error panel on the folder you do want to run jest?

the warning comes for each folder I DON'T want to run jest, even if it has a .vscode/settings.json the says :
{ "jest.autoRun": "off" }

for the folders you don't want to run jest, you could use jest. disabledWorkspaceFolders

AH! that works! thank you!

is this a new repo? If not, did it work with the previous version (3.2.0)?

yes, and I did not work with previous versions

@connectdotz
Copy link
Collaborator

the warning comes for each folder I DON'T want to run jest, even if it has a .vscode/settings.json the says :
{ "jest.autoRun": "off" }`

yeah the jest.autoRun:"off" means the extension will not run jest tests "automatically", i.e. it switched to "on-demand" mode, which will still try to get the metadata such as how many tests are there to report status and prepare for the future run.

Therefore, if you simply do not plan to run any test in the given folder, the jest.disabledWorkspaceFolders is the right setting to use.

If this resolved your issue, feel free to close it.

@bodote bodote closed this as completed May 12, 2021
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

2 participants