mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-04 08:03:14 +00:00
fix(desktop): change detection on Windows, especially Cygwin (#13659)
Co-authored-by: LukeParkerDev <10430890+Hona@users.noreply.github.com>
This commit is contained in:
@@ -286,6 +286,40 @@ describe("filesystem", () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe("windowsPath()", () => {
|
||||
test("converts Git Bash paths", () => {
|
||||
if (process.platform === "win32") {
|
||||
expect(Filesystem.windowsPath("/c/Users/test")).toBe("C:/Users/test")
|
||||
expect(Filesystem.windowsPath("/d/dev/project")).toBe("D:/dev/project")
|
||||
} else {
|
||||
expect(Filesystem.windowsPath("/c/Users/test")).toBe("/c/Users/test")
|
||||
}
|
||||
})
|
||||
|
||||
test("converts Cygwin paths", () => {
|
||||
if (process.platform === "win32") {
|
||||
expect(Filesystem.windowsPath("/cygdrive/c/Users/test")).toBe("C:/Users/test")
|
||||
expect(Filesystem.windowsPath("/cygdrive/x/dev/project")).toBe("X:/dev/project")
|
||||
} else {
|
||||
expect(Filesystem.windowsPath("/cygdrive/c/Users/test")).toBe("/cygdrive/c/Users/test")
|
||||
}
|
||||
})
|
||||
|
||||
test("converts WSL paths", () => {
|
||||
if (process.platform === "win32") {
|
||||
expect(Filesystem.windowsPath("/mnt/c/Users/test")).toBe("C:/Users/test")
|
||||
expect(Filesystem.windowsPath("/mnt/z/dev/project")).toBe("Z:/dev/project")
|
||||
} else {
|
||||
expect(Filesystem.windowsPath("/mnt/c/Users/test")).toBe("/mnt/c/Users/test")
|
||||
}
|
||||
})
|
||||
|
||||
test("ignores normal Windows paths", () => {
|
||||
expect(Filesystem.windowsPath("C:/Users/test")).toBe("C:/Users/test")
|
||||
expect(Filesystem.windowsPath("D:\\dev\\project")).toBe("D:\\dev\\project")
|
||||
})
|
||||
})
|
||||
|
||||
describe("writeStream()", () => {
|
||||
test("writes from Web ReadableStream", async () => {
|
||||
await using tmp = await tmpdir()
|
||||
|
||||
Reference in New Issue
Block a user