jest.disabledWorkspaceFolders not working
See original GitHub issueEnvironment
-
node -v
: v10.16.2 -
npm -v
: 6.10.3 -
npm ls jest
ornpm ls react-scripts
(if you haven’t ejected): jest@24.9.0 -
your vscode-jest settings if customized:
-
Operating system: Win 10
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
ornode_modules/.bin/jest
) npm run test
Steps to Reproduce
- add
"jest.disabledWorkspaceFolders": [ ".history" ],
to your settings. - install the VS-Code Extension Local History
- Edit some test, so that the history extension will create a copy of the test file(with the path) in the /.history/ folder (of your root).
- check if a test file is in that folder
- run tests
- See that the Test from the history folder will also be run.
Expected Behavior
I expected the test from the .history folder not to be executed, as I put the folder name in the jest.disabledWorkspaceFolders setting.
Actual Behavior
The tests in the folders will be executed every time with the others.
This problem has nothing to do with the other extension, as I could have created the folder and files my self for whatever purpose. I just did name it here to show that this is not an unusual scenario.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:7
Top Results From Across the Web
vscode jest extension doesn't work properly - Stack Overflow
I had been running tests using WSL2 with no issues (without the extension), but encountered "jest command not found" with the extension. After...
Read more >Configuring Jest for Visual Studio Code - Beyond Java
The Jest plugin for VS Code is a bit shy. By default, it hides most of its helpful features. Here's how to unlock...
Read more >vscode-jest - Visual Studio Marketplace
disabledWorkspaceFolders" to exclude the packages from jest run. Please note, a working jest environment is a prerequisite for this extension.
Read more >Troubleshooting - Jest
Use this guide to resolve issues with Jest. ... There are multiple ways to debug Jest tests with Visual Studio Code's built-in debugger....
Read more >Visual Studio Code tips for monorepo development with Multi ...
disabledWorkspaceFolders : Disable Jest when running from the ROOT and app1 folders, based on the folder names. Read more about troubleshooting ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
it worked for me when I used exactly the same name as defined in
folders
as mentioned by @patspamI believe vscode-jest auto-inserts the “jest.disabledWorkspaceFolders” settings into the wrong place when you click on the UI to insert it. I had to put it in my workspace settings and specifically put it inside the “settings” key/object, so in your case it’d look something like: