diff --git a/README.md b/README.md index 8d07b7433..d54797336 100644 --- a/README.md +++ b/README.md @@ -219,7 +219,7 @@ shows the autoRun will be triggered by either test or source file changes. ### How to use the Test Explorer? Users with `vscode` v1.59 and `vscode-jest` v4.1 and up will start to see tests appearing in the test explorer automatically. Test explorer provides a "test-centric" view, allows users to run/debug tests directly from the explorer (in addition to the inline debug codeLens), and provides a native terminal output experience (with colors!): -![TestExplorer-5.1.jpg](images/TestExplorer-5.1.jpg) +![TestExplorer-5.1.jpg](images/testExplorer-5.1.jpg) **How to toggle autoRun for the workspace?** - In TestExplorer, click on the root of the test tree, i.e. the one with the workspace name and the current autoRun mode. You will see a list of buttons to its right. @@ -356,7 +356,7 @@ There are 2 ways to change autoRun: 1. Temporarily [toggle autRun on/off in TestExplorer](#how-to-toggle-auto-run) 2. Change "jest.autoRun" in `settings.json` file. -**autoRun Configuration** +**autoRun Configuration** ```ts AutoRun = diff --git a/images/main-features-5.0.1.jpg b/images/main-features-5.0.1.jpg new file mode 100644 index 000000000..fb7359bd1 Binary files /dev/null and b/images/main-features-5.0.1.jpg differ diff --git a/release-notes/release-note-v5.md b/release-notes/release-note-v5.md index 84037083e..8e28c17c4 100644 --- a/release-notes/release-note-v5.md +++ b/release-notes/release-note-v5.md @@ -1,38 +1,66 @@ # vscode-jest v5 Releases --- -- [v5.0.0 (pre-release)](#v500-pre-release) - - [Features](#features) - - [Output Terminals](#output-terminals) - - [Login Shell Support](#login-shell-support) - - [Long Run Monitor](#long-run-monitor) - - [One-click disable non-jest folder for monorepo project](#one-click-disable-non-jest-folder-for-monorepo-project) +- [v5.0 (pre-release) (roll-up)](#v50-pre-release-roll-up) + - [Main Features](#main-features) + - [1. toggle autoRun and coverage through TestExplorer inline menu](#1-toggle-autorun-and-coverage-through-testexplorer-inline-menu) + - [2. automate monorepo project setup through "Setup Tool"](#2-automate-monorepo-project-setup-through-setup-tool) + - [3. improve test run output with terminal](#3-improve-test-run-output-with-terminal) + - [4. deep activation](#4-deep-activation) + - [5. login shell support](#5-login-shell-support) + - [6. long run monitor](#6-long-run-monitor) + - [7. one-click disable non-jest folder for monorepo project](#7-one-click-disable-non-jest-folder-for-monorepo-project) + - [8. autoRun change](#8-autorun-change) - [Fixes](#fixes) - - [Deep Activation](#deep-activation) - - [AutoRun Default Change](#autorun-default-change) - - [Incorrect TestExplorer tests passed count](#incorrect-testexplorer-tests-passed-count) - [Breaking Changes](#breaking-changes) + - [Change log](#change-log) --- -## v5.0.0 (pre-release) +## v5.0 (pre-release) (roll-up) -After more than an year with the vscode TestExplorer, it has been proven stable and a preferred user-experience. In v5.0.0 we started to consolidate and clean up redundant legacy functions/UI in favor of TestExplorer, such as moving run output to Terminal, retire legacy test status decorators and settings. +v5 mainly focuses on addressing performance and ease of use. The goal is to help new and experienced users fully utilize the extension features to make testing a fun experience. -This release also aim to address some common pain points, such as slow and resource-intensive start-up (especially for large projects), shell env issue (cmd not found), shallow activation and "greedy" monorepo runs. +We have also decided to make TestExplorer a preferred UI outlet instead of our custom UI developed before TestExplorer. For example, we no longer support the inline decorator for test status as TestExplorer provided a much more powerful gutter status/menu. +### Main Features -### Features +![main-features-5.0](images/../../images/main-features-5.0.1.jpg) -#### Output Terminals +#### 1. toggle autoRun and coverage through TestExplorer inline menu +This allows quick one-click change of autoRun and test-coverage for runtime only. This allow users to change test-run behavior frequently to adapt to different phrases in the development cycle. Hopefully, it also help new users that experiences performance issues to be able to self-help easily. -![v5-output-terminals](../images/v5-output-terminals.png) +More details can be found in +- [how to toggle autoRun](../README.md#how-to-toggle-auto-run) +- [how to toggle coverage](../README.md#how-to-toggle-coverage) + +Also updated README targeting performance: [performance troubleshooting](https://github.com/jest-community/vscode-jest#performance-issue) guide and [autoRun trade-off](../README.md#autorun) consideration. + + ([v5.0.1](https://github.com/jest-community/vscode-jest/releases/tag/v5.0.1): [#932](https://github.com/jest-community/vscode-jest/pull/932) - @connectdotz) + +#### 2. automate monorepo project setup through "Setup Tool" + +This expanded setup-tool (renamed from setup wizard) to help convert monorepo projects from single-root to multi-root workspaces and assisting detecting `jest.rootPath`. + +See [setup monorepo project guide](https://github.com/jest-community/vscode-jest/blob/master/setup-wizard.md#setup-monorepo-project) for more info. + +([v5.0.1](https://github.com/jest-community/vscode-jest/releases/tag/v5.0.1): [#921](https://github.com/jest-community/vscode-jest/pull/921) - @connectdotz) + +#### 3. improve test run output with terminal Jest run will be shown in Terminal instead of OUTPUT tab to provide familiar run-in-terminal-like experience. We also fixed a few bugs that prevented the full output to be shown. It should be much easier to investigate when tests fail or not executed. We will no longer force "reveal" the last run output terminal. The new terminals will only be automatically "revealed" when encountered errors prevented tests to run. Therefore, we are retiring setting `"jest.showTerminalOnLaunch"` -([#910](https://github.com/jest-community/vscode-jest/pull/910) - @connectdotz) +([v5.0.0](https://github.com/jest-community/vscode-jest/releases/tag/v5.0.0): [#910](https://github.com/jest-community/vscode-jest/pull/910) - @connectdotz) + +#### 4. deep activation -#### Login Shell Support +The extension auto activates (showing "Jest" in status bar and TestExplorer) when it detects jest config files or modules under the project root. For more sophisticated projects that jest root !== project root, they will not be activated automatically even if they set the `jest.rootPath`. In v5, we will look for jest config files in the whole project tree, except in "node_modules" for performance reason. + +For projects do not meet any of the existing activation events, there is now a new activation event for `".vscode-jest"` file, an empty marker file, anywhere in the project tree (however, prefer to be in jest root folder). + +([v5.0.0](https://github.com/jest-community/vscode-jest/releases/tag/v5.0.0): [#907](https://github.com/jest-community/vscode-jest/pull/907) - @connectdotz) + +#### 5. login shell support vscode process env doesn't always fully initialized, especially during restart. This usually manifest into command not found errors (exit code 127), such as `"env: node: No such file or directory"` or `"env: yarn: No such file or directory"` when running jest process. @@ -43,50 +71,50 @@ While there are many work arounds, we want to add one more option for users pref Note, the extra initialization might have some performance overhead, use this with caution. -(#874 - @connectdotz) -([#874](https://github.com/jest-community/vscode-jest/pull/874) - @connectdotz) +([v5.0.0](https://github.com/jest-community/vscode-jest/releases/tag/v5.0.0): [#874](https://github.com/jest-community/vscode-jest/pull/874) - @connectdotz) -#### Long Run Monitor +#### 6. long run monitor In v5 we also added a long-run monitor to be proactive in helping users detect and potential workaround such situation. The threshold setting ["jest.monitorLongRun"](../README.md#monitorlongrun) default is 60 seconds: `"jest.monitorLongRun": 60000`, -([#904](https://github.com/jest-community/vscode-jest/pull/904) - @connectdotz) - -#### One-click disable non-jest folder for monorepo project +([v5.0.0](https://github.com/jest-community/vscode-jest/releases/tag/v5.0.0): [#904](https://github.com/jest-community/vscode-jest/pull/904) - @connectdotz) -The current monorepo jest detection is "greedy", it assumes all multi-root folders have jest tests. Indeed it's not ideal and we do plan to fix it. Until then, users can now one-click to "disable" the failed folders from the error message window. +#### 7. one-click disable non-jest folder for monorepo project -([#896](https://github.com/jest-community/vscode-jest/pull/896) - @jonnytest1) +Users can now easily one-click to "disable" the failed folder from the error message window. -### Fixes - -#### Deep Activation - -The extension auto activates (showing "Jest" in status bar and TestExplorer) when it detects jest config files or modules under the project root. For more sophisticated projects that jest root !== project root, they will not be activated automatically even if they set the `jest.rootPath`. In v5, we will look for jest config files in the whole project tree, except in "node_modules" for performance reason. - -For projects do not meet any of the existing activation events, there is now a new activation event for `".vscode-jest"` file, an empty marker file, anywhere in the project tree (however, prefer to be in jest root folder). +([v5.0.0](https://github.com/jest-community/vscode-jest/releases/tag/v5.0.0): [#896](https://github.com/jest-community/vscode-jest/pull/896) - @jonnytest1) -([#907](https://github.com/jest-community/vscode-jest/pull/907) - @connectdotz) - -#### AutoRun Default Change +#### 8. autoRun change +1. Introducing [autoRun short-hand](../README.md#autorun-config) to make setting up autoRun easier +2. Change autoRun default to drop running all tests on start-up (this is potentially a breaking change) + The `"jest.autoRun"` default used to be `{"watch": "true", "onStartup": ["all-tests"]}`. While this ensure no test would be "missing", it does take a toll for start up performance, especially for projects with many expensive tests. With TestExplorer provided complete test tree view, we believe it should be all right for most users to just starts with `{"watch": "true"}`, thus the change. If you already have the `"jest.autoRun"` in your settings.json file, nothing will change. If you didn't have `"jest.autoRun"`, then you will probably notice a faster start-up, but maybe not all tests are run and marked as circle (unknown) instead. These are the files that have not checkout/changed therefore less risk of being broken (determined by watchman). Of course users can always run them explicitly or change the setting if desired. -([#906](https://github.com/jest-community/vscode-jest/pull/906) - @connectdotz) +:speech_balloon: Discussion: Giving the nature of autoRun trade-off (performance vs. completeness/automation), we would love to hear from our users: +- [what is your autoRun setting?](https://github.com/jest-community/vscode-jest/discussions/933) +- [autoRun default... what should it be?](https://github.com/jest-community/vscode-jest/discussions/934) + -#### Incorrect TestExplorer tests passed count -Fixed the test suites got counted toward these counts. +([v5.0.0](https://github.com/jest-community/vscode-jest/releases/tag/v5.0.0): [#906](https://github.com/jest-community/vscode-jest/pull/906) - @connectdotz) -([#916](https://github.com/jest-community/vscode-jest/pull/916) - @connectdotz) +### Fixes +- address issues that vscode runs occasionally appears to be hanging when the runs already completed. ([#926](https://github.com/jest-community/vscode-jest/pull/926), [#927](https://github.com/jest-community/vscode-jest/pull/927), [#932](https://github.com/jest-community/vscode-jest/pull/932)) +- missing runtime error detection and reporting when the run fails to start. ([#927](https://github.com/jest-community/vscode-jest/pull/927)) +- Fix quoting test names with special characters ([#928](https://github.com/jest-community/vscode-jest/pull/928)) +- fixed incorrect TestExplorer tests passed count ([#916](https://github.com/jest-community/vscode-jest/pull/916) - @connectdotz) +- various document updates ### Breaking Changes - `"jest.showTerminalOnLaunch"` is deprecated. - ["jest.textExplorer"](../README.md#testexplorer): - can not be turned off any more. - removed the "enable" and "showClassicStatus" attributes. The only valid attribute is "showInlineError". +- `"jest.autoRun` default value has changed. see detail above. +### Change log +- [v5.0.1 pre-release](https://github.com/jest-community/vscode-jest/releases/tag/v5.0.1) +- [v5.0.0 pre-release](https://github.com/jest-community/vscode-jest/releases/tag/v5.0.0) ---- - -Detailed changes: [v5.0.0 pre-release](https://github.com/jest-community/vscode-jest/releases/tag/v5.0.0) diff --git a/src/extensionManager.ts b/src/extensionManager.ts index fe86ab915..9523635d6 100644 --- a/src/extensionManager.ts +++ b/src/extensionManager.ts @@ -463,5 +463,6 @@ export class ExtensionManager { const ReleaseNoteBase = 'https://github.com/jest-community/vscode-jest/blob/master/release-notes'; const ReleaseNotes: Record = { - '5.0.0': `${ReleaseNoteBase}/release-note-v5.md#v500-pre-release`, + '5.0.1': `${ReleaseNoteBase}/release-note-v5.md#v50-pre-release-roll-up`, + '5.0.0': `${ReleaseNoteBase}/release-note-v5.md#v50-pre-release-roll-up`, }; diff --git a/tests/extensionManager.test.ts b/tests/extensionManager.test.ts index c6b01dfcb..6591a6231 100644 --- a/tests/extensionManager.test.ts +++ b/tests/extensionManager.test.ts @@ -816,7 +816,7 @@ describe('ExtensionManager', () => { ${1} | ${'4.6'} | ${false} | ${undefined} | ${false} ${2} | ${'5.0.0'} | ${true} | ${undefined} | ${false} ${3} | ${'5.0.0'} | ${true} | ${'See What Is Changed'} | ${true} - ${4} | ${'5.0.1'} | ${false} | ${undefined} | ${false} + ${4} | ${'5.0.1'} | ${true} | ${undefined} | ${false} ${5} | ${'6.0.0'} | ${false} | ${undefined} | ${false} `( 'show release note once for specific version: case $case',