From ee439faa3883df5b5ad1973d36bdc853ef60a8c1 Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Fri, 17 Oct 2025 11:21:55 -0700 Subject: [PATCH] fix tests --- core/tools/implementations/lsTool.vitest.ts | 2 +- core/tools/implementations/viewSubdirectory.vitest.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/core/tools/implementations/lsTool.vitest.ts b/core/tools/implementations/lsTool.vitest.ts index b697a90c5..c3c571294 100644 --- a/core/tools/implementations/lsTool.vitest.ts +++ b/core/tools/implementations/lsTool.vitest.ts @@ -25,7 +25,7 @@ test("resolveLsToolDirPath handles dot", () => { }); test("resolveLsToolDirPath handles dot relative", () => { - expect(resolveLsToolDirPath("./hi")).toBe("/hi"); + expect(resolveLsToolDirPath("./hi")).toBe("./hi"); }); test("resolveLsToolDirPath normalizes backslashes to forward slashes", () => { diff --git a/core/tools/implementations/viewSubdirectory.vitest.ts b/core/tools/implementations/viewSubdirectory.vitest.ts index f13b6d524..1bbd6243a 100644 --- a/core/tools/implementations/viewSubdirectory.vitest.ts +++ b/core/tools/implementations/viewSubdirectory.vitest.ts @@ -6,12 +6,13 @@ describe("viewSubdirectoryImpl", () => { it("should throw DirectoryNotFound when resolveInputPath returns null", async () => { const mockExtras = { ide: { - fileExists: vi.fn().mockResolvedValue(true), + fileExists: vi.fn().mockResolvedValue(false), + getWorkspaceDirs: vi.fn().mockResolvedValue(["file:///workspace"]), }, llm: {}, }; - // Mock resolveInputPath to return null (imported function would need to be mocked in actual test) + // resolveInputPath will return null when path doesn't exist await expect( viewSubdirectoryImpl( { directory_path: "/non/existent/path" }, @@ -24,6 +25,7 @@ describe("viewSubdirectoryImpl", () => { const mockExtras = { ide: { fileExists: vi.fn().mockResolvedValue(false), // Path doesn't exist + getWorkspaceDirs: vi.fn().mockResolvedValue(["file:///workspace"]), }, llm: {}, };