firsttris / vscode-jest-runner

Simple way to run or debug one or more tests from context menu, codelens or command plalette
https://marketplace.visualstudio.com/items?itemName=firsttris.vscode-jest-runner
MIT License
265 stars 124 forks source link

Add config option to preserve editor focus on test run #205

Closed akowalz closed 3 years ago

akowalz commented 3 years ago

Add configuration option preserveEditorFocus to preserve focus on your editor when running specs.

Adding the config:

{
  "jestRunner.preserveEditorFocus": true
}

...will preserve focus on your editor, instead of focusing the terminal, when a Jest test run is started. This is a helpful option available in test runners for other languages (such as the very popular Code Runner extension), and is great for vim-like workflows.

Preserving focus is accomplished simply by passing the config value to the preserveFocus? argument of the Terminal .show() method, with a default of false.

I did not see a relevant place to add a spec, but am happy to provide one.

Closes https://github.com/firsttris/vscode-jest-runner/issues/97

akowalz commented 3 years ago

@firsttris any interest in taking a look at this? I have been using this option locally for the last week and it works great 🙂

firsttris commented 3 years ago

@akowalz good work! appreciate you contribution!