mirror of https://github.com/openclaw/openclaw.git
Tests: reuse QMD availability mock type
This commit is contained in:
parent
ec13f6d73e
commit
fca8880968
|
|
@ -1,15 +1,8 @@
|
|||
import type { OpenClawConfig } from "openclaw/plugin-sdk/memory-core-host-engine-foundation";
|
||||
import type { checkQmdBinaryAvailability as checkQmdBinaryAvailabilityFn } from "openclaw/plugin-sdk/memory-core-host-engine-qmd";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
type CheckQmdBinaryAvailability = (params: {
|
||||
command: string;
|
||||
env: NodeJS.ProcessEnv;
|
||||
cwd?: string;
|
||||
timeoutMs?: number;
|
||||
}) => Promise<{
|
||||
available: boolean;
|
||||
error?: string;
|
||||
}>;
|
||||
type CheckQmdBinaryAvailability = typeof checkQmdBinaryAvailabilityFn;
|
||||
|
||||
function createManagerStatus(params: {
|
||||
backend: "qmd" | "builtin";
|
||||
|
|
|
|||
|
|
@ -1,16 +1,7 @@
|
|||
import path from "node:path";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
|
||||
type CheckQmdBinaryAvailability = (params: {
|
||||
command: string;
|
||||
env: NodeJS.ProcessEnv;
|
||||
cwd?: string;
|
||||
timeoutMs?: number;
|
||||
}) => Promise<{
|
||||
available: boolean;
|
||||
error?: string;
|
||||
}>;
|
||||
import type { checkQmdBinaryAvailability as checkQmdBinaryAvailabilityFn } from "../plugin-sdk/memory-core-host-engine-qmd.js";
|
||||
|
||||
const note = vi.hoisted(() => vi.fn());
|
||||
const resolveDefaultAgentId = vi.hoisted(() => vi.fn(() => "agent-default"));
|
||||
|
|
@ -18,6 +9,7 @@ const resolveAgentDir = vi.hoisted(() => vi.fn(() => "/tmp/agent-default"));
|
|||
const resolveMemorySearchConfig = vi.hoisted(() => vi.fn());
|
||||
const resolveApiKeyForProvider = vi.hoisted(() => vi.fn());
|
||||
const resolveActiveMemoryBackendConfig = vi.hoisted(() => vi.fn());
|
||||
type CheckQmdBinaryAvailability = typeof checkQmdBinaryAvailabilityFn;
|
||||
const checkQmdBinaryAvailability = vi.hoisted(() =>
|
||||
vi.fn<CheckQmdBinaryAvailability>(async () => ({ available: true })),
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue