fix tests

This commit is contained in:
Patrick Erichsen 2025-10-17 11:21:55 -07:00
parent 0670852a15
commit ee439faa38
2 changed files with 5 additions and 3 deletions

View file

@ -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", () => {

View file

@ -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: {},
};