From 3b635bb6d5fb5c1a46ee1e057fbaaac644d6fec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tommy=20Jos=C3=A9povic?= Date: Fri, 5 Jul 2024 14:50:03 -0400 Subject: [PATCH] fix it again --- packages/create-schemas/tests/utils.test.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/create-schemas/tests/utils.test.ts b/packages/create-schemas/tests/utils.test.ts index 6714f78..6a76742 100644 --- a/packages/create-schemas/tests/utils.test.ts +++ b/packages/create-schemas/tests/utils.test.ts @@ -33,12 +33,17 @@ describe.concurrent("utils", () => { expect(result).toBe("file:///C:/input"); }); - test("input as absolute path", ({ expect }) => { + test("input as absolute path", ({ expect, onTestFinished }) => { + vi.spyOn(process, "cwd").mockImplementation(() => "/cwd"); + onTestFinished(() => { + vi.resetAllMocks(); + }); + const input = "/input"; const result = toFullyQualifiedURL(input); - expect(result).toBe("file:///C:/input"); + expect(result).toBe("file:///input"); }); test("input as relative path", ({ expect, onTestFinished }) => {