test: clarify plugin registry cleanup · openclaw/openclaw@79b8822
steipete
·
2026-05-08
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -121,7 +121,7 @@ describe("registerPluginHttpRoute", () => {
|
121 | 121 | |
122 | 122 | expect(registry.httpRoutes).toHaveLength(0); |
123 | 123 | expect(logs).toEqual(['plugin: webhook path missing for account "default"']); |
124 | | -expect(() => unregister()).not.toThrow(); |
| 124 | +unregister(); |
125 | 125 | }); |
126 | 126 | |
127 | 127 | it("replaces stale route on same path when replaceExisting=true", () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -486,7 +486,7 @@ describe("plugin interactive handlers", () => {
|
486 | 486 | }; |
487 | 487 | |
488 | 488 | try { |
489 | | -expect(() => clearPluginInteractiveHandlers()).not.toThrow(); |
| 489 | +clearPluginInteractiveHandlers(); |
490 | 490 | const hydrated = globalStore[stateKey] as { |
491 | 491 | interactiveHandlers?: Map<string, unknown>; |
492 | 492 | callbackDedupe?: { clear: () => void }; |
@@ -496,7 +496,7 @@ describe("plugin interactive handlers", () => {
|
496 | 496 | if (!hydrated.callbackDedupe) { |
497 | 497 | throw new Error("expected hydrated callback dedupe"); |
498 | 498 | } |
499 | | -expect(() => hydrated.callbackDedupe?.clear()).not.toThrow(); |
| 499 | +hydrated.callbackDedupe.clear(); |
500 | 500 | expect(hydrated.inflightCallbackDedupe).toBeInstanceOf(Set); |
501 | 501 | |
502 | 502 | const handler = vi.fn(async () => ({ handled: true })); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。