test: dedupe channel setup mock reads · openclaw/openclaw@73907fd
steipete
·
2026-05-13
·
via Recent Commits to openclaw:main
File tree
src/commands/channel-setup
| Original file line number | Diff line number | Diff line change |
|---|
@@ -208,10 +208,7 @@ function expectSetupSnapshotDoesNotScopeToPlugin(params: {
|
208 | 208 | }); |
209 | 209 | |
210 | 210 | expect(loadOpenClawPlugins).toHaveBeenCalledTimes(1); |
211 | | -const firstLoadCall = vi.mocked(loadOpenClawPlugins).mock.calls.at(0)?.[0] as |
212 | | -| { onlyPluginIds?: string[] } |
213 | | -| undefined; |
214 | | -expect(firstLoadCall?.onlyPluginIds).toStrictEqual([]); |
| 211 | +expect(requireMockCallArg(vi.mocked(loadOpenClawPlugins), 0).onlyPluginIds).toStrictEqual([]); |
215 | 212 | } |
216 | 213 | |
217 | 214 | beforeEach(() => { |
@@ -300,11 +297,7 @@ async function runInitialValueForChannel(channel: "dev" | "beta") {
|
300 | 297 | runtime, |
301 | 298 | }); |
302 | 299 | |
303 | | -const call = select.mock.calls.at(0); |
304 | | -if (!call) { |
305 | | -throw new Error("Expected select call"); |
306 | | -} |
307 | | -return call[0]?.initialValue; |
| 300 | +return requireMockCallArg(select, 0).initialValue; |
308 | 301 | } |
309 | 302 | |
310 | 303 | function expectPluginLoadedFromLocalPath( |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。