test(feishu): reset lifecycle monitor state · openclaw/openclaw@32d1ccd
vincentkoc
·
2026-06-16
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | // Feishu plugin module implements lifecycle support behavior. |
2 | 2 | import { vi, type Mock } from "vitest"; |
| 3 | +import { testingHooks as dedupTestingHooks } from "./dedup.js"; |
| 4 | +import { testingHooks as processingClaimTestingHooks } from "./processing-claims.js"; |
3 | 5 | |
4 | 6 | type BoundConversation = { |
5 | 7 | bindingId: string; |
@@ -89,6 +91,8 @@ export function getFeishuLifecycleTestMocks(): FeishuLifecycleTestMocks {
|
89 | 91 | } |
90 | 92 | |
91 | 93 | export function resetFeishuLifecycleTestMocks(): void { |
| 94 | +dedupTestingHooks.resetFeishuDedupForTests(); |
| 95 | +processingClaimTestingHooks.resetFeishuMessageProcessingClaimsForTests(); |
92 | 96 | for (const mock of Object.values(feishuLifecycleTestMocks)) { |
93 | 97 | mock.mockReset(); |
94 | 98 | } |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -58,3 +58,9 @@ export function releaseFeishuMessageProcessing(
|
58 | 58 | processingClaims.delete(key); |
59 | 59 | } |
60 | 60 | } |
| 61 | + |
| 62 | +export const testingHooks = { |
| 63 | +resetFeishuMessageProcessingClaimsForTests() { |
| 64 | +processingClaims.clear(); |
| 65 | +}, |
| 66 | +}; |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。