Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert ProjectWorkspace rootPath to upper-case drive-letter in windows #720

Merged
merged 1 commit into from
May 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Bug-fixes within the same version aren't needed
* add `--watchAll=false` to non-watch tasks - @connectdotz
* move save related operations to new SaveTextDocument event listeners to prevent duplicate firing and losing test state for watch-mode + clean-doc-save combination. - @connectdotz
* move testFile state to ResultProvider that provides a union of test-files and actual results, to be more robust even when there is a race condition when fileList comes after test run. - @connectdotz
* convert to upper-case drive letter for ProjectWorkspace rootPath - @connectdotz
-->

### 4.0.2
Expand Down
4 changes: 2 additions & 2 deletions src/JestExt/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ProjectWorkspace } from 'jest-editor-support';
import { JestProcessRequest } from '../JestProcessManagement';
import { PluginResourceSettings, JestExtAutoRunConfig } from '../Settings';
import { AutoRunMode } from '../StatusBar';
import { pathToJest, pathToConfig } from '../helpers';
import { pathToJest, pathToConfig, toFilePath } from '../helpers';
import { workspaceLogging } from '../logging';
import { AutoRunAccessor, JestExtContext } from './types';
import { CoverageColors } from '../Coverage';
Expand Down Expand Up @@ -81,7 +81,7 @@ export const createJestExtContext = (
const currentJestVersion = 20;
const [jestCommandLine, pathToConfig] = getJestCommandSettings(settings);
const runnerWorkspace = new ProjectWorkspace(
settings.rootPath,
toFilePath(settings.rootPath),
jestCommandLine,
pathToConfig,
currentJestVersion,
Expand Down
10 changes: 7 additions & 3 deletions tests/JestExt/helper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { ProjectWorkspace } from 'jest-editor-support';
import { workspaceLogging } from '../../src/logging';
import { pathToJest, pathToConfig } from '../../src/helpers';
import { mockProjectWorkspace } from '../test-helper';
import { toFilePath } from '../../src/helpers';

describe('createJestExtContext', () => {
const workspaceFolder: any = { name: 'workspace' };
Expand Down Expand Up @@ -84,11 +85,14 @@ describe('createJestExtContext', () => {
});
});
it('will create runnerWorkspace', () => {
const settings: any = {};
(ProjectWorkspace as jest.Mocked<any>).mockReturnValue({});
const rootPath = 'abc';
const settings: any = { rootPath };
const mockRunnerWorkspace = { rootPath };
(ProjectWorkspace as jest.Mocked<any>).mockReturnValue(mockRunnerWorkspace);
const context = createJestExtContext(workspaceFolder, settings);
expect(ProjectWorkspace).toBeCalled();
expect(context.runnerWorkspace).toEqual({});
expect(toFilePath).toBeCalledWith(rootPath);
expect(context.runnerWorkspace).toEqual(mockRunnerWorkspace);
});
it('will create logging factory', () => {
const settings: any = {};
Expand Down