fix: file content search test (#721)

This commit is contained in:
jnjpng
2026-01-28 12:45:00 -08:00
committed by GitHub
parent b3a2b91e74
commit a0e0fa1bae

View File

@@ -63,13 +63,15 @@ describe("SearchFileContent tool", () => {
});
test("validates pattern parameter", async () => {
// Test that pattern is required
testDir = new TestDirectory();
testDir.createFile("test.txt", "Hello World");
// Empty pattern matches all lines (valid ripgrep behavior)
const result = await search_file_content({
pattern: "",
dir_path: ".",
dir_path: testDir.path,
} as Parameters<typeof search_file_content>[0]);
// Empty pattern just returns no results
expect(result.message).toBeTruthy();
expect(result.message).toContain("Hello World");
});
});