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
* fix auto-focus issue; adding more diagnosis messages; clean up dead files
* prepare for release 6.2.2
* make conflict warning message non-modal and more consistent with the rest of the doc
* updated release note
The `outputConfig` controls the Jest output experience by specifying when and where to create, display, and clear the output content. It supports 2 output panels: `TEST RESULTS` and `TERMINAL`. The `TEST RESULTS` panel displays test results in the order they were run, while the `TERMINAL` panel organizes outputs by workspace folder. `TERMINAL` panel also contains the non-test run outputs, such as [quick-fix link](#quick-fix-chooser), extension auto-config info and tips.
351
+
The `outputConfig` controls the Jest output experience by specifying when and where to create, display, and clear the output content. It supports 2 output panels: `TEST RESULTS` and `TERMINAL`. The `TEST RESULTS` panel displays test results in the order they were run, while the `TERMINAL` panel organizes outputs by workspace folder. `TERMINAL` panel also contains the non-test run outputs, such as [quick-fix link](#quick-fix-chooser), extension auto-config info, and tips.
352
352
353
353
**Type Definitions**
354
354
```ts
@@ -387,8 +387,8 @@ 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
-
**Handling Conflicts with "TEST RESULTS" panel**
391
390
<aid="outputconfig-conflict"></a>
391
+
**Handling Conflicts with "TEST RESULTS" panel**
392
392
393
393
_The Problem_
394
394
@@ -404,14 +404,25 @@ _Further Customization_
404
404
405
405
However, if you prefer "TEST RESULTS" and "TERMINAL" panels to behave differently and don't mind managing 2 settings yourself, you could play with different combinations.
406
406
407
-
For instance, if `"testing.openTesting"` is set to `"openOnTestFailure"`, and you want your terminal panel to still reveal when any tests run, your setting would look like this: `"jest.outputConfig": {revealWithFocus: "test-results"}`
407
+
For instance, if `"testing.openTesting"` is set to `"openOnTestFailure"`, and you want your terminal panel to still reveal when any tests run, your setting would look like this: `"jest.outputConfig": {revealWithFocus: "terminal"}`.
408
+
409
+
_Validation and Diagnosis_
410
+
411
+
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
+
<aid="outputconfig-issues"></a>
414
+
**Common Issues**
408
415
409
-
_Built-in Validation_
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.
410
417
411
-
The extension also features built-in conflict detection and quick fixes to assist.
418
+
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.
412
423
413
424
**Examples**
414
-
- Choose a passive output experience that is identical to the previous version.
425
+
- Choose a passive output experience that is identical to the previous version: no automatic focus switch, no automatic clear.
415
426
```json
416
427
"testing.openTesting": "neverOpen",
417
428
"jest.outputConfig": "neutral"
@@ -421,20 +432,17 @@ The extension also features built-in conflict detection and quick fixes to assis
421
432
"testing.openTesting": "neverOpen",
422
433
"jest.outputConfig": "terminal-based"
423
434
```
424
-
- Choose a test-results-based experience and switch focus to it when test fails.
435
+
- Choose a test-results-based experience and switch focus to it when test run starts.
425
436
```json
426
437
"testing.openTesting": "neverOpen",
427
-
"jest.outputConfig": {
428
-
"revealOn": "error",
429
-
"revealWithFocus": "test-results",
430
-
}
438
+
"jest.outputConfig": "test-results-based"
431
439
```
432
-
alternatively:
440
+
- Choose a test-results-based experience and switch focus to it when test fails.
433
441
```json
434
-
"testing.openTesting": "openOnTestFailure",
442
+
"testing.openTesting": "neverOpen",
435
443
"jest.outputConfig": {
436
444
"revealOn": "error",
437
-
"revealWithFocus": "test-results"
445
+
"revealWithFocus": "test-results",
438
446
}
439
447
```
440
448
- Clear the terminal output on each run but do not automatically switch focus to any panel.
@@ -556,10 +564,11 @@ While the concepts of performance and automation are generally clear, "completen
556
564
2. If you modify the source or test code, potential failures in other tests may remain hidden until they are explicitly run.
557
565
3. Tests bearing dynamic names, like those using test.each with variables or template literals, won't be translated. As a result, they must be executed through higher-level constructs, such as describe blocks with static names or entire test suites.
558
566
559
-
560
-
<aid="runmode-migration"></a>
561
-
**Migration Guide**
562
-
Starting from v6.1.0, if no runMode is defined in settings.json, the extension will automatically generate one using legacy settings (`autoRun`, `showCoverageOnLoad`). To migrate, simply use the `"Jest: Save Current RunMode"` command from the command palette to update the setting, then remove the deprecated settings.
567
+
> [!NOTE]
568
+
> <aid="runmode-migration"></a>
569
+
> **Migration Guide**
570
+
>
571
+
> Starting from v6.1.0, if no runMode is defined in settings.json, the extension will automatically generate one using legacy settings (`autoRun`, `showCoverageOnLoad`). To migrate, simply use the `"Jest: Save Current RunMode"` command from the command palette to update the setting, then remove the deprecated settings.
-[3. Control extension activation within each folder](#3-control-extension-activation-within-each-folder)
30
32
-[4. Auto clear output upon test run](#4-auto-clear-output-upon-test-run)
31
33
-[Fixes](#fixes)
32
-
-[CHANGELOG](#changelog-2)
34
+
-[CHANGELOG](#changelog-3)
33
35
34
36
---
35
37
38
+
## v6.2.2
39
+
This release is a patch release with the following changes:
40
+
41
+
**Enhancement**
42
+
43
+
- Improved output config validation logic and showed warning if detected upon starting up. ([#1119](https://github.com/jest-community/vscode-jest/pull/1119) - @connectdotz)
44
+
45
+
- Added more diagnosis and fix-it instructions in the jest terminal: ([#1119](https://github.com/jest-community/vscode-jest/pull/1119) - @connectdotz)
46
+
47
+
- Display critical settings such as "jest.runMode", "jest.outputConfig" and "testing.openTesting" settings
48
+
- Provide warning messages for common output issues, such as aggressive auto-focus for auto run modes, when detected. Provides quick fix instructions to address them.
49
+
50
+
51
+
**Bug Fixes**
52
+
- Fixed an outputConfig initialization bug that did not honor "testing.openTesting": "openOnTestFailure" setting correctly. ([#1119](https://github.com/jest-community/vscode-jest/pull/1119) - @connectdotz)
53
+
54
+
**New Command**
55
+
- Added a new command `"Jest: Disable Auto Focus Test Output"` to easily disable TEST RESULTS panel auto focus. It will set the output to the "neutral" mode, i.e., no auto focusing. ([#1119](https://github.com/jest-community/vscode-jest/pull/1119) - @connectdotz)
56
+
57
+
58
+
**Documentation**
59
+
- Minor docs updates for the migration guides. ([#1116](https://github.com/jest-community/vscode-jest/pull/1116) - @pmcelhaney)
60
+
- Minor update for the output config info in README and release notes. ([#1119](https://github.com/jest-community/vscode-jest/pull/1119) - @connectdotz)
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}`;
42
+
41
43
/** extract lines starts and end with [] */
42
44
exportclassJestExt{
43
45
coverageMapProvider: CoverageMapProvider;
@@ -139,8 +141,12 @@ export class JestExt {
139
141
if(pluginSettings.enable===false){
140
142
thrownewError(`Jest is disabled for workspace ${workspaceFolder.name}`);
0 commit comments