Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
DScheglov opened this issue Feb 27, 2024 · 4 comments
Closed

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

DScheglov opened this issue Feb 27, 2024 · 4 comments

Comments

@DScheglov
Copy link

DScheglov commented Feb 27, 2024

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):

  • vscode-jest version: v6.2.2
  • node -v: 20.7.0
  • npm -v or yarn --version: 10.1.0
  • jest or react-scripts (if you haven’t ejected) version:
  • your vscode-jest settings:
    • jest.jestCommandLine: is absent in ~/.config/Code/User/settings.json
    • jest.runMode: is absent in ~/.config/Code/User/settings.json
    • jest.outputConfig? is absent in ~/.config/Code/User/settings.json
    • jest.autoRevealOutput: "off"
  • Operating system: Ubuntu 22.04

Prerequisite

  • are you able to run jest from the command line?
    • yes
  • where do you run jest CLI from?
    • project root
  • how do you run your tests from the command line?
    • npm test
@DScheglov
Copy link
Author

DScheglov commented Feb 27, 2024

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
Copy link
Collaborator

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
Copy link
Author

Hi, @connectdotz

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

@connectdotz
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants