Skip to content

Commit 39c7da3

Browse files
authored
fix path tests on windows (RooCodeInc#3276)
1 parent 5275f2e commit 39c7da3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/utils/path.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,20 @@ describe("Path Utilities", () => {
3434
})
3535

3636
it("should show relative paths within cwd", () => {
37-
const cwd = "/home/user/project"
38-
const filePath = "/home/user/project/src/file.txt"
37+
const cwd = path.resolve("/home/user/project")
38+
const filePath = path.resolve("/home/user/project/src/file.txt")
3939
getReadablePath(cwd, filePath).should.equal("src/file.txt")
4040
})
4141

4242
it("should show basename when path equals cwd", () => {
43-
const cwd = "/home/user/project"
43+
const cwd = path.resolve("/home/user/project")
4444
getReadablePath(cwd, cwd).should.equal("project")
4545
})
4646

4747
it("should show absolute path when outside cwd", () => {
48-
const cwd = "/home/user/project"
49-
const filePath = "/home/user/other/file.txt"
50-
getReadablePath(cwd, filePath).should.equal(filePath)
48+
const cwd = path.resolve("/home/user/project")
49+
const filePath = path.resolve("/home/user/other/file.txt")
50+
getReadablePath(cwd, filePath).should.equal(filePath.toPosix())
5151
})
5252
})
5353
})

0 commit comments

Comments
 (0)