mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-12 03:05:45 +00:00
test(memory-core): keep memory tool mock local to plugin
This commit is contained in:
parent
3cea11d3b6
commit
975e69b00b
4 changed files with 5 additions and 21 deletions
|
|
@ -39,20 +39,7 @@ const readAgentMemoryFileMock = vi.fn(
|
|||
async (params: MemoryReadParams) => await readFileImpl(params),
|
||||
);
|
||||
|
||||
const { memoryIndexModuleId, memoryToolsRuntimeModuleId } = vi.hoisted(() => ({
|
||||
memoryIndexModuleId: "../../extensions/memory-core/src/memory/index.js",
|
||||
memoryToolsRuntimeModuleId: "../../extensions/memory-core/src/tools.runtime.js",
|
||||
}));
|
||||
|
||||
vi.mock(memoryIndexModuleId, () => ({
|
||||
getMemorySearchManager: getMemorySearchManagerMock,
|
||||
}));
|
||||
|
||||
vi.mock("../../src/memory-host-sdk/host/read-file.js", () => ({
|
||||
readAgentMemoryFile: readAgentMemoryFileMock,
|
||||
}));
|
||||
|
||||
vi.mock(memoryToolsRuntimeModuleId, () => ({
|
||||
vi.mock("./tools.runtime.js", () => ({
|
||||
resolveMemoryBackendConfig: ({
|
||||
cfg,
|
||||
}: {
|
||||
|
|
@ -14,7 +14,7 @@ import {
|
|||
setMemorySearchImpl,
|
||||
setMemoryWorkspaceDir,
|
||||
type MemoryReadParams,
|
||||
} from "../../../test/helpers/memory-tool-manager-mock.js";
|
||||
} from "./memory-tool-manager-mock.js";
|
||||
import { createMemoryCoreTestHarness } from "./test-helpers.js";
|
||||
import {
|
||||
asOpenClawConfig,
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import type { MemorySearchResult } from "openclaw/plugin-sdk/memory-core-host-runtime-files";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import type { OpenClawConfig } from "../api.js";
|
||||
import {
|
||||
resetMemoryToolMockState,
|
||||
setMemoryBackend,
|
||||
setMemorySearchImpl,
|
||||
} from "../../../test/helpers/memory-tool-manager-mock.js";
|
||||
import type { OpenClawConfig } from "../api.js";
|
||||
} from "./memory-tool-manager-mock.js";
|
||||
import { createMemorySearchTool } from "./tools.js";
|
||||
|
||||
type RecordShortTermRecallsFn = (params: {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
import { beforeEach, describe, it } from "vitest";
|
||||
import {
|
||||
resetMemoryToolMockState,
|
||||
setMemorySearchImpl,
|
||||
} from "../../../test/helpers/memory-tool-manager-mock.js";
|
||||
import { resetMemoryToolMockState, setMemorySearchImpl } from "./memory-tool-manager-mock.js";
|
||||
import {
|
||||
createMemorySearchToolOrThrow,
|
||||
expectUnavailableMemorySearchDetails,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue