jest-community / vscode-jest

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

Running test from "Test explorer" changes view to "File explorer" #994

Open bmutafov opened 1 year ago

bmutafov commented 1 year ago

Environment

  1. vscode-jest version: v5.1.0
  2. node -v: v12.22.7
  3. npm -v or yarn --version: npm 6.14.15
  4. npm ls jest or npm ls react-scripts (if you haven’t ejected): react-scripts@5.0.1
  5. your vscode-jest settings if customized:
    • jest.jestCommandLine? npm test --
    • jest.autoRun
{
  "watch": false,
  "onSave": "test-file"
}
  1. Operating system: Windows 11

Prerequisite

Steps to Reproduce

  1. Click Test explorer
  2. Click Run test
  3. Sidebar view is switched to File explorer

Relevant Debug Info

VSCode Version:

$ code -v
1.74.3
97dec172d3256f8ca4bfb2143f3f76b503ca0534
x64

Expected Behavior

Sidebar view stays on Test explorer

Actual Behavior

jest-test


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

connectdotz commented 1 year ago

Is there any related error message in the console log?

bmutafov commented 1 year ago

Is there any related error message in the console log?

Nothing that I can see, no.

connectdotz commented 1 year ago

If you run individual tests from the editor gutter menu or test explorer tree item, does it also switch to file explorer? Do you have a sample repo we can try to repro this issue?

bmutafov commented 1 year ago

Yes, from both it focuses the file in the file explorer. As for a sample repo, I just tried setting up a brand new CRA app with typescript and it is present even there:

npx create-react-app my-app --template typescript

And then try to run App.test.tsx tests. The issue is present for me. VSCode version:

❯ code -v
1.75.1
441438abd1ac652551dbe4d408dfcec8a499b8bf
x64

Extension version v5.2.3