diff --git a/README.md b/README.md index 36e096676..db762ac22 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ You can see the full [features](#features) and learn more details in the [How-To Happy testing! ## Releases -- **Current** ([v6.2.4](https://github.com/jest-community/vscode-jest/releases/tag/v6.2.4)): [release note](release-notes/release-note-v6.md#v624) +- **Current** ([v6.2.5](https://github.com/jest-community/vscode-jest/releases/tag/v6.2.5)): [release note](release-notes/release-note-v6.md#v625) - **Previous** ([v5.2.3](https://github.com/jest-community/vscode-jest/releases/tag/v5.2.3)): [release note](release-notes/release-note-v5.x.md#v523) diff --git a/release-notes/release-note-v6.md b/release-notes/release-note-v6.md index 873357948..45ba04a35 100644 --- a/release-notes/release-note-v6.md +++ b/release-notes/release-note-v6.md @@ -3,6 +3,7 @@ Release Notes --- +- [v6.2.5](#v625) - [v6.2.4](#v624) - [v6.2.3](#v623) - [v6.2.2](#v622) @@ -37,17 +38,37 @@ Release Notes --- +## v6.2.5 + +**Bug Fixes** + +- Fixed an issue (#1145) where an autoRun (watch, on-save) might not update the test status in Editor and TestExplorer in subsequent runs. ([#1146](https://github.com/jest-community/vscode-jest/pull/1146) - @connectdotz) + +**CHANGELOG** + +- [v6.2.5](https://github.com/jest-community/vscode-jest/releases/tag/v6.2.5) + +--- + ## v6.2.4 **Enhancements** + - Improved handling of zombie Jest processes during on-demand runs for scenarios like [stencil](https://github.com/jest-community/vscode-jest/issues/1124#issuecomment-2000596099) and [rt-test](https://github.com/jest-community/vscode-jest/issues/1137#issuecomment-2048570421), which previously failed to correctly interpret `"watchAll=false"`. We encourage users to report issues to the underlying systems. In the meantime, this extension will automatically terminate such zombie processes during on-demand runs, preventing them from blocking the execution queue. ([#1134](https://github.com/jest-community/vscode-jest/pull/1134) - @connectdotz) **Bug Fixes** + - Fixed an issue where the Test Explorer's `Stop` button did not terminate the underlying Jest process, potentially blocking the execution queue for subsequent on-demand runs. ([#1134](https://github.com/jest-community/vscode-jest/pull/1134) - @connectdotz) - Resolved a problem where the "Jest: Run All Tests" command was obstructed by the watch mode's ongoing execution. ([#1132](https://github.com/jest-community/vscode-jest/pull/1132) - @connectdotz) +**CHANGELOG** + +- [v6.2.4](https://github.com/jest-community/vscode-jest/releases/tag/v6.2.4) + +--- ## v6.2.3 + This release is a patch release with the following changes: **Enhancement** @@ -55,7 +76,14 @@ This release is a patch release with the following changes: - 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) - docs: update README to fix jest run mode type. ([#1126](https://github.com/jest-community/vscode-jest/pull/1126) - @kota-kamikawa) +**CHANGELOG** + +- [v6.2.3](https://github.com/jest-community/vscode-jest/releases/tag/v6.2.3) + +--- + ## v6.2.2 + This release is a patch release with the following changes: **Enhancement** @@ -81,8 +109,11 @@ This release is a patch release with the following changes: - Minor update for the output config info in README and release notes. ([#1119](https://github.com/jest-community/vscode-jest/pull/1119) - @connectdotz) ### CHANGELOG + - [v6.2.2](https://github.com/jest-community/vscode-jest/releases/tag/v6.2.2) +--- + ## v6.2.1 This release is a patch release with the following bug fix: @@ -90,6 +121,8 @@ This release is a patch release with the following bug fix: ### CHANGELOG - [v6.2.1](https://github.com/jest-community/vscode-jest/releases/tag/v6.2.1) + +--- ## v6.2.0 This version is a rollup of pre-releases [v6.0](#v60-pre-release) through [v6.1](#v61-pre-release), which implemented a few long requested features, such as better monorepo project support, more intuitive ways to defer and resume testing, and showing accurate test results in TEST RESULT panel. diff --git a/src/extension-manager.ts b/src/extension-manager.ts index 528d2a238..3542ade49 100644 --- a/src/extension-manager.ts +++ b/src/extension-manager.ts @@ -531,6 +531,7 @@ export class ExtensionManager { const ReleaseNoteBase = 'https://github.com/jest-community/vscode-jest/blob/master/release-notes'; const ReleaseNotes: Record = { + '6.2.5': `${ReleaseNoteBase}/release-note-v6.md#v625`, '6.2.4': `${ReleaseNoteBase}/release-note-v6.md#v624`, '6.2.3': `${ReleaseNoteBase}/release-note-v6.md#v623`, '6.2.2': `${ReleaseNoteBase}/release-note-v6.md#v622`, diff --git a/src/test-provider/jest-test-run.ts b/src/test-provider/jest-test-run.ts index bb1547072..332f79c5a 100644 --- a/src/test-provider/jest-test-run.ts +++ b/src/test-provider/jest-test-run.ts @@ -68,7 +68,13 @@ export class JestTestRun implements JestExtOutput, TestRunProtocol { if (!this._run && !this.isCancelled) { const runName = `${this.name} (${this.runCount++})`; - this._run = this.createRun(this.request, runName); + // vscode seems to identify run by the request instance, so we need to create a new request for each run + const request = new vscode.TestRunRequest( + this.request.include, + this.request.exclude, + this.request.profile + ); + this._run = this.createRun(request, runName); this._run.appendOutput(`\r\nTestRun "${runName}" started\r\n`); // ignore skipped tests if there are more than one test to run diff --git a/tests/test-provider/jest-test-runt.test.ts b/tests/test-provider/jest-test-runt.test.ts index 02719e67a..b379aafcc 100644 --- a/tests/test-provider/jest-test-runt.test.ts +++ b/tests/test-provider/jest-test-runt.test.ts @@ -44,6 +44,8 @@ describe('JestTestRun', () => { })); mockRequest = {}; + (vscode.TestRunRequest as jest.Mocked).mockClear(); + (vscode.TestRunRequest as jest.Mocked).mockImplementation(() => mockRequest); jestRun = new JestTestRun('test', mockContext, mockRequest, mockCreateTestRun); }); @@ -365,10 +367,36 @@ describe('JestTestRun', () => { expect(run1.end).toHaveBeenCalled(); const newRequest: any = { include: ['test1'] }; + (vscode.TestRunRequest as jest.Mocked).mockImplementation(() => newRequest); jestRun.updateRequest(newRequest); jestRun.started({} as any); expect(mockCreateTestRun).toHaveBeenCalledTimes(2); - expect(mockCreateTestRun.mock.calls[1][0]).toBe(newRequest); + expect(mockCreateTestRun.mock.calls[1][0]).toEqual(newRequest); + expect(vscode.TestRunRequest).toHaveBeenCalledTimes(2); + }); + }); + + describe('supports continuous test run', () => { + it('by start/stop underlying TestRun per continuous run session', () => { + jestRun = new JestTestRun('test', mockContext, mockRequest, mockCreateTestRun); + + // first run + jestRun.started({} as any); + expect(mockCreateTestRun).toHaveBeenCalledTimes(1); + const run1 = mockCreateTestRun.mock.results[0].value; + expect(run1.started).toHaveBeenCalled(); + jestRun.end(); + expect(run1.end).toHaveBeenCalled(); + expect(vscode.TestRunRequest).toHaveBeenCalledTimes(1); + + // 2nd run + jestRun.started({} as any); + expect(mockCreateTestRun).toHaveBeenCalledTimes(2); + const run2 = mockCreateTestRun.mock.results[1].value; + expect(run2.started).toHaveBeenCalled(); + jestRun.end(); + expect(run2.end).toHaveBeenCalled(); + expect(vscode.TestRunRequest).toHaveBeenCalledTimes(2); }); }); describe('cancel', () => {