Skip to content

Commit

Permalink
fix: force spawn to use powershell on windows and fixed drive case match
Browse files Browse the repository at this point in the history
  • Loading branch information
georgemickleburgh committed Mar 30, 2022
1 parent fe4fe52 commit 04538c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pure/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export class TestRunner {
cwd: workspacePath,
stdio: ["ignore", "pipe", "pipe"],
env,
shell: isWindows,
shell: isWindows ? 'powershell' : false,
});

for await (const line of chunksToLinesAsync(child.stdout)) {
Expand Down
6 changes: 5 additions & 1 deletion src/runHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ async function runTest(
for (const file of fileItems) {
pathToFile.set(file.uri!.fsPath, file);
if (isWindows) {
pathToFile.set(file.uri!.fsPath.replace(/\\/g, "/"), file);
let windowsPath = file.uri!.fsPath.replace(/\\/g, "/");
// vscode sends path with lowercase for drive, but tests report with uppercase
// so there are no matches unless this is adjusted
windowsPath = windowsPath.charAt(0).toUpperCase() + windowsPath.slice(1);
pathToFile.set(windowsPath, file);
}
}

Expand Down

0 comments on commit 04538c6

Please sign in to comment.