mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 19:04:31 +00:00
refactor(core): dedupe shared config and runtime helpers
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { vi } from "vitest";
|
||||
import "./test-runtime-mocks.js";
|
||||
|
||||
// Avoid exporting vitest mock types (TS2742 under pnpm + d.ts emit).
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
@@ -24,18 +25,6 @@ export function resetEmbeddingMocks(): void {
|
||||
hoisted.embedQuery.mockImplementation(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" }),
|
||||
}));
|
||||
|
||||
vi.mock("./embeddings.js", () => ({
|
||||
createEmbeddingProvider: async () => ({
|
||||
requestedProvider: "openai",
|
||||
|
||||
Reference in New Issue
Block a user