Skip to content

Commit 9558aab

Browse files
Ehab YounesEhabY
authored andcommitted
Fix mocking of os and normalization of paths
1 parent 842baa8 commit 9558aab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/utils/platform.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os from "node:os";
2+
import path from "node:path";
23
import { expect } from "vitest";
34

45
export const isWindows = os.platform() === "win32";
@@ -44,7 +45,7 @@ export function quoteCommand(value: string): string {
4445
}
4546

4647
function normalizePath(p: string): string {
47-
return isWindows ? p.replace(/\\/g, "/") : p;
48+
return p.replaceAll(path.sep, "/");
4849
}
4950

5051
function getPlatformQuote(): string {

0 commit comments

Comments
 (0)