From 39c7da301c1eaf3c330b7d9675656d50339919f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Barreiro?= <52393857+BarreiroT@users.noreply.github.com> Date: Wed, 7 May 2025 18:52:58 +0200 Subject: [PATCH] fix path tests on windows (#3276) --- src/utils/path.test.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/utils/path.test.ts b/src/utils/path.test.ts index 8efa6e59e2..a75eaa6dd5 100644 --- a/src/utils/path.test.ts +++ b/src/utils/path.test.ts @@ -34,20 +34,20 @@ describe("Path Utilities", () => { }) it("should show relative paths within cwd", () => { - const cwd = "/home/user/project" - const filePath = "/home/user/project/src/file.txt" + const cwd = path.resolve("/home/user/project") + const filePath = path.resolve("/home/user/project/src/file.txt") getReadablePath(cwd, filePath).should.equal("src/file.txt") }) it("should show basename when path equals cwd", () => { - const cwd = "/home/user/project" + const cwd = path.resolve("/home/user/project") getReadablePath(cwd, cwd).should.equal("project") }) it("should show absolute path when outside cwd", () => { - const cwd = "/home/user/project" - const filePath = "/home/user/other/file.txt" - getReadablePath(cwd, filePath).should.equal(filePath) + const cwd = path.resolve("/home/user/project") + const filePath = path.resolve("/home/user/other/file.txt") + getReadablePath(cwd, filePath).should.equal(filePath.toPosix()) }) }) })