test: guard channel status plugin mock call · openclaw/openclaw@02eccba
steipete
·
2026-05-12
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -191,6 +191,14 @@ function expectResolvedTokenStatusSummary(
|
191 | 191 | } |
192 | 192 | } |
193 | 193 | |
| 194 | +function requireReadOnlyPluginListCall(): unknown[] { |
| 195 | +const call = listReadOnlyChannelPluginsForConfig.mock.calls.at(0); |
| 196 | +if (!call) { |
| 197 | +throw new Error("expected listReadOnlyChannelPluginsForConfig call"); |
| 198 | +} |
| 199 | +return call; |
| 200 | +} |
| 201 | + |
194 | 202 | describe("config-only channels status output", () => { |
195 | 203 | it("uses setup fallback plugins so configured external channels can be shown", async () => { |
196 | 204 | registerSingleTestPlugin("token-only", makeUnavailableTokenPlugin()); |
@@ -200,7 +208,7 @@ describe("config-only channels status output", () => {
|
200 | 208 | await formatLocalStatusSummary(cfg); |
201 | 209 | |
202 | 210 | expect(listReadOnlyChannelPluginsForConfig).toHaveBeenCalledOnce(); |
203 | | -expect(listReadOnlyChannelPluginsForConfig.mock.calls[0]).toStrictEqual([ |
| 211 | +expect(requireReadOnlyPluginListCall()).toStrictEqual([ |
204 | 212 | cfg, |
205 | 213 | { activationSourceConfig: cfg, includeSetupFallbackPlugins: true }, |
206 | 214 | ]); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。