You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-22Lines changed: 19 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -387,14 +387,15 @@ This setting can be one of the predefined types or a custom object.
387
387
4. "none": Do not clear any panel. (default)
388
388
(_**Note**: As of the current version, the testing framework does not support the clearing of the "TEST RESULTS" panel without side effects. The closest available command also clears all test item statuses, which may not be desirable. We are aware of this limitation and will raise the issue with the VS Code team._)
389
389
390
+
390
391
<aid="outputconfig-conflict"></a>
391
-
**Handling Conflicts with "TEST RESULTS" panel**
392
+
**Handling Conflicts with "TEST RESULTS" panel setting**
392
393
393
394
_The Problem_
394
395
395
396
The behavior of the "TEST RESULTS" panel is influenced by VSCode's native `"testing.openTesting"` setting. This can cause inconsistencies with your `"jest.outputConfig"` settings.
396
397
397
-
For instance, if you set `"jest.outputConfig": {"revealWithFocus": "none"}` to prevent automatic focus changes, but leave `"testing.openTesting"` at its default value of `"openOnTestStart"`, the "TEST RESULTS" panel will still automatically switch focus whenever tests run.
398
+
For instance, if you set `"jest.outputConfig": {"revealWithFocus": "none"}` to prevent automatic focus changes, but leave `"testing.openTesting"` at its default value of `"openOnTestStart"`, the "TEST RESULTS" panel will still automatically switch focus when the tests are run via UI.
398
399
399
400
_The Universal Solution_
400
401
@@ -410,18 +411,18 @@ _Validation and Diagnosis_
410
411
411
412
The extension features output config diagnosis information in the jest terminal, as well as the built-in conflict detection and quick fixes to assist with the transition.
412
413
413
-
<aid="outputconfig-issues"></a>
414
-
**Common Issues**
414
+
<aid="default-output-focus"></a>
415
+
**Default Output Focus Behavior by RunMode**
416
+
When none of the output settings (`"testing.openTesting"` and `"jest.outputConfig"`) are present, The default output behavior is determined by [runMode](#runmode):
415
417
416
-
Upon upgrading to v6.2, some users, frequently with auto run modes (e.g., 'watch', 'on-save'), might experience frequent "TEST RESULTS" panel automatically grabbing focus whenever files are saved or tests are run.
418
+
| runMode| auto reveal "TEST RESULTS" | auto reveal "TERMINAL" |
This is due to the extension generates a default `jest.outputConfig`, if none is existing in your settings, to match the existing `testing.openTesting` setting, which defaults to `"openOnTestStart"`. If this is not your desired output experience, you can easily disable `testing.openTesting` in your settings.json:
419
-
```json
420
-
"testing.openTesting": "neverOpen"
421
-
```
422
-
Then use the `jest.outputConfig` to find-tune the output experience you prefer.
423
424
424
-
**Examples**
425
+
**Configuration Examples**
425
426
- Choose a passive output experience that is identical to the previous version: no automatic focus switch, no automatic clear.
426
427
```json
427
428
"testing.openTesting": "neverOpen",
@@ -432,12 +433,7 @@ Then use the `jest.outputConfig` to find-tune the output experience you prefer.
432
433
"testing.openTesting": "neverOpen",
433
434
"jest.outputConfig": "terminal-based"
434
435
```
435
-
- Choose a test-results-based experience and switch focus to it when test run starts.
436
-
```json
437
-
"testing.openTesting": "neverOpen",
438
-
"jest.outputConfig": "test-results-based"
439
-
```
440
-
- Choose a test-results-based experience and switch focus to it when test fails.
436
+
- Choose a test-results-based experience and switch focus to it only when test fails.
441
437
```json
442
438
"testing.openTesting": "neverOpen",
443
439
"jest.outputConfig": {
@@ -457,16 +453,17 @@ Then use the `jest.outputConfig` to find-tune the output experience you prefer.
457
453
> <aid="outputconfig-migration"></a>
458
454
> **Migration Guide**
459
455
>
460
-
> Migrating to the new `"jest.outputConfig"`can require some manual adjustments, especially if you're working in a multi-root workspace. Here are some guidelines to help with the transition:
456
+
> Migrating to the new `"jest.outputConfig"`might require some manual adjustments, especially if you're working in a multi-root workspace. Here are some guidelines to help with the transition:
461
457
>
462
458
> 1.**Workspace Level vs Workspace-Folder Level**: The new `"jest.outputConfig"` is a workspace-level setting, unlike legacy settings like `"jest.autoClearTerminal"` and `"jest.autoRevealOutput"`, which are workspace-folder level settings.
463
459
>
464
460
> 2.**Backward Compatibility**: If no `"jest.outputConfig"` is defined in your settings.json, the extension will attempt to generate a backward-compatible outputConfig in memory. This uses the `"testing.openTesting"` setting and any legacy settings (`"jest.autoClearTerminal"`, `"jest.autoRevealOutput"`) you might have. Note that this might only work for single-root workspaces.
465
461
>
466
-
> 3.**Migration Steps**:
467
-
> - Use the `"Jest: Save Current Output Config"` command from the command palette to update your settings.json.
468
-
> - (optional) Fix warning: The save does not include `"testing.openTesting"`, so you might see the conflict warning message. You can either use the "Quick Fix" action or adjust the `settings.json` manually (see [handling conflict](#outputconfig-conflict)).
469
-
> - Finally, remove any deprecated settings.
462
+
> 3.**Customization Steps**:
463
+
In general it should work out of the box, but if you encounter any issues, here are some steps to help adjusting the output behavior:
464
+
> - Use the `"Jest: Save Current Output Config"` command from the command palette to update your settings.json. Then adjust it to fit your needs.
465
+
> - Fix warning if any: The save does not include `"testing.openTesting"`, so you might see the conflict warning message. You can either use the "Quick Fix" action or adjust the `settings.json` manually (see [handling conflict](#outputconfig-conflict)).
466
+
> - Finally, remove any deprecated settings.
470
467
>
471
468
> By following these guidelines, you should be able to smoothly transition to using `"jest.outputConfig"`.
This release is a patch release with the following changes:
41
+
42
+
**Enhancement**
43
+
44
+
- Improve output-focus default behavior for auto runs (e.g., "watch", "on-save"). This will eliminate the issue that the focus auto switching to "TEST RESULTS" panel whenever files are saved in auto-run modes. Now the default behavior is runMode aware and will not auto switch for auto runs unless specifically configured to do so. See [default output focus behavior](https://github.com/jest-community/vscode-jest#default-output-focus). ([#1128](https://github.com/jest-community/vscode-jest/pull/1128) - @connectdotz)
45
+
- docs: update README to fix jest run mode type. ([#1126](https://github.com/jest-community/vscode-jest/pull/1126) - @kota-kamikawa)
46
+
38
47
## v6.2.2
39
48
This release is a patch release with the following changes:
constAUTO_FOCUS_WARNING=`The TEST RESULTS panel has auto-focus enabled, which may cause frequent focus shifts during the current run mode. If this becomes a problem, you can disable the auto-focus using the command "Jest: Disable Auto Focus Test Output". Alternatively, click on the action link below. For more details, see ${OUTPUT_CONFIG_HELP_URL}`;
0 commit comments