jest-community / vscode-jest

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

Jest tests being run on file save despite watch mode being disabled #802

Closed JordanLongstaff closed 2 years ago

JordanLongstaff commented 2 years ago

Environment

  1. vscode-jest version: 4.2.1
  2. node -v: 14.17.5
  3. npm -v or yarn --version: 6.14.14 and 1.22.17, respectively
  4. npm ls jest or npm ls react-scripts (if you haven’t ejected): jest@26.6.3
  5. your vscode-jest settings if customized:
    • jest.autoRun: { "watch": "false", "onStartup": ["all-tests"] }
  6. Operating system: macOS Monterey 12.0.1

Prerequisite

Steps to Reproduce

All I do is save a file, and then Jest suddenly runs all of the available tests (and does so multiple times, which really bogs down VS Code). This is in spite of the fact that I have explicitly disabled watch mode entirely, as indicated by the above setting.

Expected Behavior

The tests should not be running in response to a code file being saved.

Actual Behavior

They are.


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

JordanLongstaff commented 2 years ago

"jest.autoRun": "off" works fine, but it's the previous setting that doesn't, which is disappointing because it means that I can't make Jest tests run when VS Code starts. Both autorun modes are referred to as auto-run-off, and yet one of them is misleading because it is inaccurate.

connectdotz commented 2 years ago

Try false without quotes

JordanLongstaff commented 2 years ago

Jeez, I feel so dumb. Thanks!