diff --git a/src/memory/index.test.ts b/src/memory/index.test.ts index 6581a658b6..b82f06afa0 100644 --- a/src/memory/index.test.ts +++ b/src/memory/index.test.ts @@ -6,6 +6,14 @@ import { getMemorySearchManager, type MemoryIndexManager } from "./index.js"; let embedBatchCalls = 0; +// Unit tests: avoid importing the real chokidar implementation (native fsevents, etc.). +vi.mock("chokidar", () => ({ + default: { + watch: () => ({ on: () => {}, close: async () => {} }), + }, + watch: () => ({ on: () => {}, close: async () => {} }), +})); + vi.mock("./sqlite-vec.js", () => ({ loadSqliteVecExtension: async () => ({ ok: false, error: "sqlite-vec disabled in tests" }), })); diff --git a/src/memory/manager.batch.test.ts b/src/memory/manager.batch.test.ts index 8ad9cb2773..bd29d8f6e7 100644 --- a/src/memory/manager.batch.test.ts +++ b/src/memory/manager.batch.test.ts @@ -7,6 +7,14 @@ import { getMemorySearchManager, type MemoryIndexManager } from "./index.js"; const embedBatch = vi.fn(async () => []); const embedQuery = vi.fn(async () => [0.5, 0.5, 0.5]); +// Unit tests: avoid importing the real chokidar implementation (native fsevents, etc.). +vi.mock("chokidar", () => ({ + default: { + watch: () => ({ on: () => {}, close: async () => {} }), + }, + watch: () => ({ on: () => {}, close: async () => {} }), +})); + vi.mock("./sqlite-vec.js", () => ({ loadSqliteVecExtension: async () => ({ ok: false, error: "sqlite-vec disabled in tests" }), })); diff --git a/src/memory/manager.embedding-batches.test.ts b/src/memory/manager.embedding-batches.test.ts index 466ecacbc0..db709ce854 100644 --- a/src/memory/manager.embedding-batches.test.ts +++ b/src/memory/manager.embedding-batches.test.ts @@ -7,6 +7,14 @@ import { getMemorySearchManager, type MemoryIndexManager } from "./index.js"; const embedBatch = vi.fn(async (texts: string[]) => texts.map(() => [0, 1, 0])); const embedQuery = vi.fn(async () => [0, 1, 0]); +// Unit tests: avoid importing the real chokidar implementation (native fsevents, etc.). +vi.mock("chokidar", () => ({ + default: { + watch: () => ({ on: () => {}, close: async () => {} }), + }, + watch: () => ({ on: () => {}, close: async () => {} }), +})); + vi.mock("./sqlite-vec.js", () => ({ loadSqliteVecExtension: async () => ({ ok: false, error: "sqlite-vec disabled in tests" }), })); diff --git a/src/memory/manager.embedding-token-limit.test.ts b/src/memory/manager.embedding-token-limit.test.ts index 53e73f897e..9e2b836b5b 100644 --- a/src/memory/manager.embedding-token-limit.test.ts +++ b/src/memory/manager.embedding-token-limit.test.ts @@ -7,6 +7,14 @@ import { getMemorySearchManager, type MemoryIndexManager } from "./index.js"; const embedBatch = vi.fn(async (texts: string[]) => texts.map(() => [0, 1, 0])); const embedQuery = vi.fn(async () => [0, 1, 0]); +// Unit tests: avoid importing the real chokidar implementation (native fsevents, etc.). +vi.mock("chokidar", () => ({ + default: { + watch: () => ({ on: () => {}, close: async () => {} }), + }, + watch: () => ({ on: () => {}, close: async () => {} }), +})); + vi.mock("./sqlite-vec.js", () => ({ loadSqliteVecExtension: async () => ({ ok: false, error: "sqlite-vec disabled in tests" }), }));