Skip to content

Commit

Permalink
Fixed test run errors due to incorrect sub folder paths from the test…
Browse files Browse the repository at this point in the history
… Explorer panel
  • Loading branch information
connectdotz committed Feb 14, 2024
1 parent c8a66f9 commit 029db33
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 24 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
"node_modules/jest-editor-support/src": false
},
"typescript.tsdk": "./node_modules/typescript/lib",
// jest
"jest.runMode":"on-demand",
// "testing.openTesting": "neverOpen",
// eslint
"tslint.enable": false,
"eslint.enable": true,
Expand Down
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.0](https://github.com/jest-community/vscode-jest/releases/tag/v6.2.0)): [release note](release-notes/release-note-v6.md#v620)
- **Current** ([v6.2.1](https://github.com/jest-community/vscode-jest/releases/tag/v6.2.1)): [release note](release-notes/release-note-v6.md#v621)
- **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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vscode-jest",
"displayName": "Jest",
"description": "Use Facebook's Jest With Pleasure.",
"version": "6.2.0",
"version": "6.2.1",
"publisher": "Orta",
"engines": {
"vscode": "^1.68.1"
Expand Down
14 changes: 12 additions & 2 deletions release-notes/release-note-v6.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
Release Notes <!-- omit in toc -->
---

- [v6.2.1](#v621)
- [CHANGELOG](#changelog)
- [v6.2.0](#v620)
- [New Features Summary](#new-features-summary)
- [Bug Fixes and Technical Debt Reduction](#bug-fixes-and-technical-debt-reduction)
- [Breaking Changes](#breaking-changes)
- [CHANGELOG](#changelog)
- [CHANGELOG](#changelog-1)
- [v6.1 (pre-release)](#v61-pre-release)
- [Main Features](#main-features)
- [1. Enhanced Test Execution Control with "runMode"](#1-enhanced-test-execution-control-with-runmode)
Expand All @@ -27,10 +29,18 @@ Release Notes <!-- omit in toc -->
- [3. Control extension activation within each folder](#3-control-extension-activation-within-each-folder)
- [4. Auto clear output upon test run](#4-auto-clear-output-upon-test-run)
- [Fixes](#fixes)
- [CHANGELOG](#changelog-1)
- [CHANGELOG](#changelog-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. ([#1113](https://github.com/jest-community/vscode-jest/pull/1113) - @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
10 changes: 1 addition & 9 deletions src/extension-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -529,17 +529,9 @@ export class ExtensionManager {

const ReleaseNoteBase = 'https://github.com/jest-community/vscode-jest/blob/master/release-notes';
const ReleaseNotes: Record<string, string> = {
'6.2.1': `${ReleaseNoteBase}/release-note-v6.md#v621`,
'6.2.0': `${ReleaseNoteBase}/release-note-v6.md#v620`,
'6.1.0': `${ReleaseNoteBase}/release-note-v6.md#v610-pre-release`,
'6.0.0': `${ReleaseNoteBase}/release-note-v6.md#v600-pre-release`,
'5.2.3': `${ReleaseNoteBase}/release-note-v5.x.md#v523`,
'5.2.2': `${ReleaseNoteBase}/release-note-v5.x.md#v522`,
'5.2.1': `${ReleaseNoteBase}/release-note-v5.x.md#v521-pre-release`,
'5.2.0': `${ReleaseNoteBase}/release-note-v5.x.md#v520-pre-release`,
'5.1.0': `${ReleaseNoteBase}/release-note-v5.x.md#v510`,
'5.0.4': `${ReleaseNoteBase}/release-note-v5.md#v50-pre-release-roll-up`,
'5.0.3': `${ReleaseNoteBase}/release-note-v5.md#v50-pre-release-roll-up`,
'5.0.2': `${ReleaseNoteBase}/release-note-v5.md#v50-pre-release-roll-up`,
'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`,
};
7 changes: 1 addition & 6 deletions src/test-provider/test-item-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { JestTestRun } from './jest-test-run';
import { JestProcessInfo, JestProcessRequest } from '../JestProcessManagement';
import { GENERIC_ERROR, LONG_RUNNING_TESTS, getExitErrorDef } from '../errors';
import { tiContextManager } from './test-item-context-manager';
import { toAbsoluteRootPath } from '../helpers';
import { runModeDescription } from '../JestExt/run-mode';
import { isVirtualWorkspaceFolder } from '../virtual-workspace-folder';
import { outputManager } from '../output-manager';
Expand Down Expand Up @@ -203,11 +202,7 @@ export class WorkspaceRoot extends TestItemDataBase {
);
};
private addPath = (absoluteFileName: string): FolderData | undefined => {
const absoluteRoot = toAbsoluteRootPath(
this.context.ext.workspace,
this.context.ext.settings.rootPath
);
const relativePath = path.relative(absoluteRoot, absoluteFileName);
const relativePath = path.relative(this.item.uri!.fsPath, absoluteFileName);
const folders = relativePath.split(path.sep).slice(0, -1);

return folders.reduce(this.addFolder, undefined);
Expand Down
7 changes: 2 additions & 5 deletions tests/extension-manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1281,11 +1281,8 @@ describe('ExtensionManager', () => {
});
it.each`
case | version | showChoice | choice | showRN
${1} | ${'4.6'} | ${false} | ${undefined} | ${false}
${2} | ${'5.0.0'} | ${true} | ${undefined} | ${false}
${3} | ${'5.0.0'} | ${true} | ${"See What's Changed"} | ${true}
${4} | ${'5.0.1'} | ${true} | ${undefined} | ${false}
${5} | ${'6.0.0'} | ${true} | ${undefined} | ${false}
${2} | ${'6.2.0'} | ${true} | ${undefined} | ${false}
${3} | ${'6.2.0'} | ${true} | ${"See What's Changed"} | ${true}
${6} | ${'99.0.0'} | ${false} | ${undefined} | ${false}
`(
'show release note once for specific version: case $case',
Expand Down

0 comments on commit 029db33

Please sign in to comment.