Skip to content

Commit

Permalink
Merge branch 'master' into JES-32-upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
connectdotz authored Jun 5, 2024
2 parents 2e69fab + d241cb3 commit cfbf3f7
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
33 changes: 33 additions & 0 deletions release-notes/release-note-v6.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Release Notes <!-- omit in toc -->
---

- [v6.2.5](#v625)
- [v6.2.4](#v624)
- [v6.2.3](#v623)
- [v6.2.2](#v622)
Expand Down Expand Up @@ -37,25 +38,52 @@ Release Notes <!-- omit in toc -->

---

## 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**

- 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**
Expand All @@ -81,15 +109,20 @@ 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:

- Fixed test run errors due to incorrect sub folder paths from the test Explorer panel. ([#1114](https://github.com/jest-community/vscode-jest/pull/1114) - @connectdotz)

### 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.
Expand Down
1 change: 1 addition & 0 deletions src/extension-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,7 @@ export class ExtensionManager {

const ReleaseNoteBase = 'https://github.com/jest-community/vscode-jest/blob/master/release-notes';
const ReleaseNotes: Record<string, string> = {
'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`,
Expand Down
8 changes: 7 additions & 1 deletion src/test-provider/jest-test-run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 29 additions & 1 deletion tests/test-provider/jest-test-runt.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ describe('JestTestRun', () => {
}));

mockRequest = {};
(vscode.TestRunRequest as jest.Mocked<any>).mockClear();
(vscode.TestRunRequest as jest.Mocked<any>).mockImplementation(() => mockRequest);
jestRun = new JestTestRun('test', mockContext, mockRequest, mockCreateTestRun);
});

Expand Down Expand Up @@ -365,10 +367,36 @@ describe('JestTestRun', () => {
expect(run1.end).toHaveBeenCalled();

const newRequest: any = { include: ['test1'] };
(vscode.TestRunRequest as jest.Mocked<any>).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', () => {
Expand Down

0 comments on commit cfbf3f7

Please sign in to comment.