Skip to content

LLM Wiki is a cross-platform desktop application that turns your documents into an organized, interlinked knowledge base — automatically. Instead of traditional RAG (retrieve-and-answer from scratch every time), the LLM incrementally builds and maintains a persistent wiki from your sources。

TypeScript

test: cover image source sync ingestion

nash_su9dacddc58e10
diff --git a/src/lib/project-file-sync.test.ts b/src/lib/project-file-sync.test.ts
index 12e02d6a..5f8dd934 100644
--- a/src/lib/project-file-sync.test.ts
+++ b/src/lib/project-file-sync.test.ts
@@ -80,6 +80,7 @@ const mocks = vi.hoisted(() => {
}>),
readFile: vi.fn(async (_path?: string) => ""),
getFileSize: vi.fn(async (_path?: string) => 1024),
+ preprocessFile: vi.fn(async (path: string) => path),
fileExists: vi.fn(async (_path?: string) => false),
writeFile: vi.fn(async () => undefined),
deleteFile: vi.fn(async () => undefined),
@@ -137,6 +138,7 @@ vi.mock("@/commands/fs", () => ({
listDirectory: mocks.listDirectory,
readFile: mocks.readFile,
getFileSize: mocks.getFileSize,
+ preprocessFile: mocks.preprocessFile,
fileExists: mocks.fileExists,
writeFile: mocks.writeFile,
deleteFile: mocks.deleteFile,
@@ -186,6 +188,7 @@ describe("project file sync", () => {
mocks.listDirectory.mockImplementation(async (_path?: string) => [])
mocks.readFile.mockImplementation(async (_path?: string) => "")
mocks.getFileSize.mockImplementation(async (_path?: string) => 1024)
+ mocks.preprocessFile.mockImplementation(async (path: string) => path)
mocks.fileExists.mockImplementation(async (_path?: string) => false)
mocks.writeFile.mockImplementation(async () => undefined)
mocks.deleteFile.mockImplementation(async () => undefined)
@@ -309,6 +312,7 @@ describe("project file sync", () => {
expect(mocks.enqueueBatch).toHaveBeenCalledWith("A", [
{ sourcePath: "raw/sources/report.pdf", folderContext: "" },
+ { sourcePath: "raw/sources/image.png", folderContext: "" },
])
})