jest-community / vscode-jest

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

[BUG] Automatically switches to Test Result Tab on any file save #1122

Closed DScheglov closed 4 months ago

DScheglov commented 4 months ago

Describe the bug When I save any file in VS Code, VS Code opens the "Test Results" tab instead of the keep Terminal

To Reproduce Steps to reproduce the behavior:

  1. Edit file
  2. Type "Ctrl + S" to Save file
  3. Test Results Tab are open automatically without any need Then
  4. Try to open Terminal Tab, while tests are running
  5. Test Results Tab gets open back

Expected behavior Keep Terminal (or other tab) open

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

Prerequisite

DScheglov commented 4 months ago

Oh, I've found the broken config in the projects ./.vscode/settings.json:

  "jest.outputConfig": {
    "revealOn": "run",
    "revealWithFocus": "test-results",
    "clearOnRun": "none"
  }

After removing this config the issue is resolved. But I didn't add this config manually.

connectdotz commented 4 months ago

Hi, @DScheglov, a few questions: what is the "testing.openTesting" in your settings.json? Did you update it either through the command or manually editing the settings.json?

DScheglov commented 4 months ago

Hi, @connectdotz

esting.openTesting is absent in my settings.json. I didn't touch this setting nor manually, nor through the any command

connectdotz commented 4 months ago

ok, my guess is the jest.outputConfig is saved probably via the command "Jest: Save Current Output Config".

It's great you figured out a solution with jest.autoRevealOutput. However, please know it is a deprecated setting, the right customization is documented in here, and more background info can be found here.

In short, once you set "testing.openTesting": "neverOpen", you can remove the deprecated jest.autoRevealOutput from your settings.json.

I will close this issue as it is a duplicate of #1113 and #1111.