Skip to content

[BUG] Jest extension TESTS RESULTS console output causes VS Code to steal focus #1117

@rcbevans

Description

@rcbevans

Describe the bug
The Jest extension test output being written to the TEST RESULTS console causes VS Code to steal window focus.

To Reproduce
Steps to reproduce the behavior:

  1. Open a workspace/project with jest tests
  2. Switch to another window

Expected behavior
The tests should run in the background without stealing window focus back to VS Code

Actual behavior
Every time console output is written to the TEST RESULTS console, the host VS Code window steals focus making doing anything else impossible.

I have had to disable the jest runners to prevent auto running of tests on change because it's so disruptive.

Environment (please complete the following information):

  • vscode-jest version: v6.2.1
  • node -v: v20.10.0
  • yarn --version: v1.22.19
  • jest: v29.7.0
  • your vscode-jest settings: default, no settings in settings.json
  • Operating system: Pop!_OS 22.04 LTS

VS Code info:
Version: 1.86.2
Commit: microsoft/vscode@903b1e9
Date: 2024-02-13T19:41:37.860Z
Electron: 27.2.3
ElectronBuildId: 26908389
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Linux x64 6.6.10-76060610-generic

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? yarn test

Additional context
I'm not sure if this is necessarily a Jest extension issue of a core VS Code issue as the problem was introduced after a recent VS Code update, so I also filed an issue there.

microsoft/vscode#205766

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions