Closed Inspirateur closed 1 year ago
The jest.autoRun
setting should stop jest from automatically running. However, the extension might still try to examine your env to find the jest commands and parse the test files to put the run/debug menu for each test...
Are you seeing the jest terminal reporting something? Just curious, how do you know the tests are running? If this is related to the jest terminal, please try v5.2.0 pre-release, which will only reveal when tests are run.
Is this related?
console is empty but something is running tests. it happens only when extension enabled
sorry for video from phone IDK how to unblock os notification when screen recorders take video.
https://user-images.githubusercontent.com/6917580/214128335-37a81e10-7c98-46ab-9dea-42f0412e49ca.MOV
@NuclleaR thanks for the video, a few questions/comments:
Jest (your workspace name)
index.js
showing some red underlines. The extension does create those for test errors, is index.js
a test file? Please hover over those underlines and let us know what they show..."jest.debugMode": true
) and see if there is any indication that tests are running@connectdotz This terminal automatically opens whenever I launch the project:
Here's the settings.json
:
"jest.autoRun": {
"watch": false,
"onStartup": []
}
I also tried: "jest.autoRun": "off"
.
Here's the jest status:
This is the extension output:
(debugMode is true for all of these screenshots)
@ciriousjoker thanks for the info. The status bar "..." means no test has been run. The terminal issue has been fixed in v5.2 (#976), once you upgrade to the latest (v5.2.2), the terminal should only be shown when tests are run.
Works perfectly, thanks!
Definitly not the case, it still opens a terminal, when opening a new run vscode project with jest and npm install has not run yet. (To install dotenv)
@Johann01 If there is a "fatal error" when the extension setting up your test env, the terminal will be revealed. This does not mean the tests are run, which is what jest.autoRun
controls.
Maybe the jest.autoRun
is easily confused with "auto running the extension"? Maybe we should rename it to jest.autoTestRun
?
See more explanation about the difference between test run vs. extension run: comment
Environment
vscode-jest version
: 5.1.0node -v
: 18.12.1npm -v
: 9.1.2npm ls jest
: backend@1.0.0 D:\Documents\Repos\service-desk\backend ├── jest@27.5.1 └─┬ ts-jest@27.1.5 └── jest@27.5.1 dedupedyour vscode-jest settings if customized:
Operating system: Windows 10
Prerequisite
Steps to Reproduce
Sorry I don't have time yet to recreate a repo with the same config.
Expected Behavior
Jest should not run on vs code startup nor should it run on save.
Actual Behavior
It does.