Skip to content

Commit c70c9b5

Browse files
authored
prepare for pre-release v6.0.0 (#1043)
* update release note * added release note * fix the test
1 parent b257c32 commit c70c9b5

File tree

7 files changed

+123
-8
lines changed

7 files changed

+123
-8
lines changed

Diff for: .vscode/settings.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@
1414
"eslint.enable": true,
1515
"editor.codeActionsOnSave": {
1616
"source.fixAll.eslint": true
17-
}
17+
},
18+
"cSpell.words": [
19+
"unmock"
20+
],
1821
}

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ Users can use the following settings to tailor the extension for their environme
254254
|setting|description|default|example/notes|
255255
|---|---|---|---|
256256
|**Process**|
257+
|enable|Enable/disable jest extension for the given workspace folder/virtual-folder|true|`"jest.enable": false`|
257258
|[jestCommandLine](#jestCommandLine)|The command line to start jest tests|undefined|`"jest.jestCommandLine": "npm test --"` or `"jest.jestCommandLine": "yarn test"` or `"jest.jestCommandLine": "node_modules/.bin/jest --config custom-config.js"`|
258259
|nodeEnv|Add additional env variables to spawned jest process|null|`"jest.nodeEnv": {"PORT": "9800", "BAR":"true"}` |
259260
|[shell](#shell)|shell (path or LoginShell) for executing jest|null|`"jest.shell": "/bin/bash"` or `"jest.shell": "powershell"` or `"jest.shell": {"path": "/bin/bash"; args: ["--login"]}` |
@@ -270,7 +271,6 @@ useDashedArgs| Determine if to use dashed arguments for jest processes |undefine
270271
|[coverageFormatter](#coverageFormatter)|Determine the coverage overlay style|"DefaultFormatter"|`"jest.coverageFormatter": "GutterFormatter"`|
271272
|[coverageColors](#coverageColors)|Coverage indicator color override|undefined|`"jest.coverageColors": { "uncovered": "rgba(255,99,71, 0.2)", "partially-covered": "rgba(255,215,0, 0.2)"}`|
272273
|**Misc**|
273-
|enable|Enable/disable jest extension for the given workspace folder|true|`"jest.enable": false`|
274274
|debugMode|Enable debug mode to diagnose plugin issues. (see developer console)|false|`"jest.debugMode": true`|
275275
|disabledWorkspaceFolders 💼|Disabled workspace folders names in multi-root environment|[]|`"jest.disabledWorkspaceFolders": ["package-a", "package-b"]`|
276276
|[autoRevealOutput](#autoRevealOutput)|Determine when to show test output|"on-run"|`"jest.autoRevealOutput": "on-exec-error"`|

Diff for: release-notes/release-note-v6.md

+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# vscode-jest v6.x Releases <!-- omit in toc -->
2+
3+
Release Notes
4+
---
5+
- [Release Notes](#release-notes)
6+
- [v6.0.0 (pre-release)](#v600-pre-release)
7+
- [Main Features](#main-features)
8+
- [1. Virtual Folders](#1-virtual-folders)
9+
- [2. Support spawning jest with dashed arguments](#2-support-spawning-jest-with-dashed-arguments)
10+
- [3. control extension activation within each folder](#3-control-extension-activation-within-each-folder)
11+
- [4. Auto clear output upon test run](#4-auto-clear-output-upon-test-run)
12+
- [Fixes](#fixes)
13+
- [CHANGELOG](#changelog)
14+
15+
---
16+
17+
## v6.0.0 (pre-release)
18+
19+
This major release introduces the 'Virtual Folders' feature. Much like a VSCode workspace folder, a 'Virtual Folder' allows you to manage a custom Jest runtime environment, each configurable with its own resource-level settings. This is particularly useful for projects with multiple Jest configurations or monorepo structures. While we've ensured backward compatibility, the introduction of 'Virtual Folders' involved significant internal changes that prompted a major version bump.
20+
21+
### Main Features
22+
#### 1. Virtual Folders
23+
24+
Supporting multiple jest configs is a common use cases for monorepo projects and projects with multiple test environments, such as unit and integration tests. We introduced monorepo support with vscode multi-root workspaces a few years ago. While it works well for most use cases, it fell short for multi-test-environment that share the same code base (folder). This version will close this gap with the [Virtual Folders](README.md#virtualfolders).
25+
26+
For example, the unit vs. integration tests can now be set up as the following:
27+
```json
28+
// <project>/.vscode/settings.json
29+
{
30+
"jest.virtualFolders": [
31+
{
32+
"name": "unit-tests",
33+
"jestCommandLine": "--config=jest.unit.config.js",
34+
"autoRun": "watch"
35+
},
36+
{
37+
"name": "integration-tests",
38+
"jestCommandLine": "--config=jest.integration.config.js",
39+
"autoRun": "off"
40+
}
41+
]
42+
}
43+
```
44+
45+
And yes you can indeed use virtual folders with monorepo projects. For example, the following configuration will run tests for each package in a monorepo project:
46+
```json
47+
// <project>/.vscode/settings.json
48+
{
49+
"jest.virtualFolders": [
50+
{"name": "package1", "rootPath": "packages/package1"},
51+
{"name": "package2", "rootPath": "packages/package2"}
52+
]
53+
}
54+
```
55+
56+
So when to use multi-root workspaces vs. virtual folders? In short, if you created a multi-root workspace simply for running different jest config - you could probably just use `"jest.virtualFolders"` instead. If you do require different non-jest vscode settings for each folder, continue to use multi-root workspace. More details in [Virtual Folders](README.md#virtualfolders).
57+
58+
59+
- [#1035](https://github.com/jest-community/vscode-jest/pull/1035) - @connectdotz
60+
61+
#### 2. Support spawning jest with dashed arguments
62+
63+
In light of Angular's decision to drop support for CamelCase arguments, we've been hearing a lot of you asking for a switch to dashed-arguments when running Jest commands. Therefore, a new optional setting `"jest.useDashedArgs"` is introduced.
64+
65+
However, bear in mind that you might encounter compatibility issue with other tools/systems. For instance, we've identified an issue in react-script where `"watch-all"=false` (an argument the extension appended) isn't recognized (see facebook/react-script#12801 for more details). Please report them if you encounter any.
66+
67+
See [Customization](README.md#customization) for more details.
68+
69+
70+
<!-- cSpell:ignore mjamin -->
71+
- [jest-community/jest-editor-support#103](https://github.com/jest-community/jest-editor-support/pull/103) - @mjamin
72+
- [#1034](https://github.com/jest-community/vscode-jest/pull/1034) - @connectdotz
73+
74+
#### 3. control extension activation within each folder
75+
A new setting`"jest.enable"` is added as a quick way to turn off the extension feature for the given folder/virtual-folder without uninstall/disable completely in vscode.
76+
77+
This is indeed similar to `"jest.disabledWorkspaceFolders"`, which is a "window" level setting (on the root of the workspace). Given the target is the folder itself, we believe it makes more sense to put the control `"jest.enable"` in folder level instead. It could also provide better extensibility down the road, such as "deferred-activation". We hope `"jest.enable"` will eventually replace `"jest.disabledWorkspaceFolders"`.
78+
79+
See [Customization](README.md#customization) for more details.
80+
81+
- [#1009](https://github.com/jest-community/vscode-jest/pull/1009) - @connectdotz
82+
83+
#### 4. Auto clear output upon test run
84+
85+
Introduced a new setting - `"jest.autoClearOutput"` - to clear the output terminal before each test run. Default is false for backward compatibility. This is useful when you want to see only the last run output.
86+
87+
See [Customization](README.md#customization) for more details.
88+
89+
<!-- cSpell:ignore jgillick -->
90+
- [#1014](https://github.com/jest-community/vscode-jest/pull/1014) - @jgillick
91+
92+
### Fixes
93+
<!-- cSpell:ignore adrianisk Jazzkid0 ykray -->
94+
- Fixed v2 debug config variable substitution for multi-variable in a given argument. ([#1040](https://github.com/jest-community/vscode-jest/pull/1040) - @adrianisk)
95+
- Fixed a source code parsing error for nonLiteralName. ([#1024](https://github.com/jest-community/vscode-jest/pull/1024) - @connectdotz)
96+
- Various documentation fixes
97+
- [#1016](https://github.com/jest-community/vscode-jest/pull/1016) - @Jazzkid0
98+
- [#1023](https://github.com/jest-community/vscode-jest/pull/1023) - @connectdotz
99+
- [#1032](https://github.com/jest-community/vscode-jest/pull/1032) - @Ryan-Dia
100+
- [#1038](https://github.com/jest-community/vscode-jest/pull/1038) - @ykray (epic work!)
101+
- Address security vulnerability with dependencies. ([#1011](https://github.com/jest-community/vscode-jest/pull/1011))
102+
103+
### CHANGELOG
104+
- [v6.0.0](https://github.com/jest-community/vscode-jest/releases/tag/v6.0.0)
105+
106+
---
107+
108+

Diff for: release-notes/release-notes.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# vscode-jest Release Notes
2+
- [v6](release-note-v6.md)
23
- [v5](release-note-v5.x.md)
34
- [v4](release-note-v4.md)

Diff for: src/extension-manager.ts

+1
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,7 @@ export class ExtensionManager {
485485

486486
const ReleaseNoteBase = 'https://github.com/jest-community/vscode-jest/blob/master/release-notes';
487487
const ReleaseNotes: Record<string, string> = {
488+
'6.0.0': `${ReleaseNoteBase}/release-note-v6.md#v600-pre-release`,
488489
'5.2.3': `${ReleaseNoteBase}/release-note-v5.x.md#v523`,
489490
'5.2.2': `${ReleaseNoteBase}/release-note-v5.x.md#v522`,
490491
'5.2.1': `${ReleaseNoteBase}/release-note-v5.x.md#v521-pre-release`,

Diff for: tests/extension-manager.test.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -1223,12 +1223,13 @@ describe('ExtensionManager', () => {
12231223
expect(ext2.onDidChangeActiveTextEditor).not.toHaveBeenCalled();
12241224
});
12251225
it.each`
1226-
case | version | showChoice | choice | showRN
1227-
${1} | ${'4.6'} | ${false} | ${undefined} | ${false}
1228-
${2} | ${'5.0.0'} | ${true} | ${undefined} | ${false}
1229-
${3} | ${'5.0.0'} | ${true} | ${'See What Is Changed'} | ${true}
1230-
${4} | ${'5.0.1'} | ${true} | ${undefined} | ${false}
1231-
${5} | ${'6.0.0'} | ${false} | ${undefined} | ${false}
1226+
case | version | showChoice | choice | showRN
1227+
${1} | ${'4.6'} | ${false} | ${undefined} | ${false}
1228+
${2} | ${'5.0.0'} | ${true} | ${undefined} | ${false}
1229+
${3} | ${'5.0.0'} | ${true} | ${'See What Is Changed'} | ${true}
1230+
${4} | ${'5.0.1'} | ${true} | ${undefined} | ${false}
1231+
${5} | ${'6.0.0'} | ${true} | ${undefined} | ${false}
1232+
${6} | ${'99.0.0'} | ${false} | ${undefined} | ${false}
12321233
`(
12331234
'show release note once for specific version: case $case',
12341235
async ({ version, showChoice, choice, showRN }) => {

Diff for: tests/test-provider/test-item-data.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1165,6 +1165,7 @@ describe('test-item-data', () => {
11651165
expect(listener.dispose).toHaveBeenCalled();
11661166
});
11671167
it('can adapt raw output to terminal output', () => {
1168+
// cSpell: ignore myarn
11681169
const coloredText = '[2Kyarn run v1.22.5\n';
11691170
jestRun.write(coloredText);
11701171
expect(jestRun.vscodeRun.appendOutput).toHaveBeenCalledWith(

0 commit comments

Comments
 (0)