refactor: trim unused reply test helpers

This commit is contained in:
Peter Steinberger
2026-05-02 04:24:28 +01:00
parent 912f6693ac
commit 1f26a7821f
2 changed files with 0 additions and 30 deletions

View File

@@ -1,12 +0,0 @@
import { vi } from "vitest";
vi.mock("../../config/config.js", async () => {
const actual =
await vi.importActual<typeof import("../../config/config.js")>("../../config/config.js");
return {
...actual,
getRuntimeConfig: () => ({}),
};
});
export function installSubagentsCommandCoreMocks() {}

View File

@@ -1,10 +1,8 @@
import { importFreshModule } from "openclaw/plugin-sdk/test-fixtures";
type GetReplyModule = typeof import("./get-reply.js");
type ReplyModule = typeof import("../reply.js");
const cachedGetReplyModulePromises = new Map<string, Promise<GetReplyModule>>();
const cachedReplyModulePromises = new Map<string, Promise<ReplyModule>>();
/**
* Default to cached module loads for reply tests.
@@ -25,19 +23,3 @@ export async function loadGetReplyModuleForTest(options?: {
}
return await cached;
}
export async function loadReplyModuleForTest(options?: {
cacheKey?: string;
fresh?: boolean;
}): Promise<ReplyModule> {
if (options?.fresh) {
return await importFreshModule<ReplyModule>(import.meta.url, "../reply.js");
}
const cacheKey = options?.cacheKey ?? import.meta.url;
let cached = cachedReplyModulePromises.get(cacheKey);
if (!cached) {
cached = import("../reply.js");
cachedReplyModulePromises.set(cacheKey, cached);
}
return await cached;
}