jest-community / vscode-jest

The optimal flow for Jest based testing in VS Code
MIT License
2.84k stars 294 forks source link

Bypass jest command check for non-jest projects #1107

Closed tbsuht closed 9 months ago

tbsuht commented 10 months ago

Environment

  1. vscode-jest version: [v5.2.3]
  2. npm -v: [9.2.0]
  3. Operating system: [Debian Bookworm]

Expected Behavior

Use the extension within multi-project workspaces, without complaining about projects which are not "web-projects".

Actual Behavior

I have a multi-project workspace with various projects (C++, python, javascript ...).

The extension complains on VS Code startup about every project which is not a "web-project" the following with a lot of pop-ups:

[warn] not able to find test script or jest/CRA binary in any of the package roots

[error] Abort jest session: Not able to auto detect a valid jest command

The extension is working fine for the projects which contain jest tests.

Is there a way to omit this, so that such projects can be skipped? Or that the discovery is not done on startup? Yes, I can click "Ignore folder", but I want to define this "programmatically".

connectdotz commented 10 months ago

Hi, this can be done with jest.disabledWorkspaceFolders in 5.x or jest.enable in 6.x. See https://github.com/jest-community/vscode-jest?tab=readme-ov-file#settings for more details.

tbsuht commented 9 months ago

Thanks!