refactor: trim unused reply test helpers · openclaw/openclaw@1f26a78
steipete
·
2026-05-02
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { importFreshModule } from "openclaw/plugin-sdk/test-fixtures"; |
2 | 2 | |
3 | 3 | type GetReplyModule = typeof import("./get-reply.js"); |
4 | | -type ReplyModule = typeof import("../reply.js"); |
5 | 4 | |
6 | 5 | const cachedGetReplyModulePromises = new Map<string, Promise<GetReplyModule>>(); |
7 | | -const cachedReplyModulePromises = new Map<string, Promise<ReplyModule>>(); |
8 | 6 | |
9 | 7 | /** |
10 | 8 | * Default to cached module loads for reply tests. |
@@ -25,19 +23,3 @@ export async function loadGetReplyModuleForTest(options?: {
|
25 | 23 | } |
26 | 24 | return await cached; |
27 | 25 | } |
28 | | - |
29 | | -export async function loadReplyModuleForTest(options?: { |
30 | | -cacheKey?: string; |
31 | | -fresh?: boolean; |
32 | | -}): Promise<ReplyModule> { |
33 | | -if (options?.fresh) { |
34 | | -return await importFreshModule<ReplyModule>(import.meta.url, "../reply.js"); |
35 | | -} |
36 | | -const cacheKey = options?.cacheKey ?? import.meta.url; |
37 | | -let cached = cachedReplyModulePromises.get(cacheKey); |
38 | | -if (!cached) { |
39 | | -cached = import("../reply.js"); |
40 | | -cachedReplyModulePromises.set(cacheKey, cached); |
41 | | -} |
42 | | -return await cached; |
43 | | -} |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。