test: guard browser control auth mock calls · openclaw/openclaw@7f8d37b
steipete
·
2026-05-12
·
via Recent Commits to openclaw:main
File tree
extensions/browser/src/browser
| Original file line number | Diff line number | Diff line change |
|---|
@@ -64,7 +64,11 @@ vi.mock("../gateway/auth.js", () => ({
|
64 | 64 | })); |
65 | 65 | |
66 | 66 | function readPersistedConfig(): OpenClawConfig { |
67 | | -const persistedCfg = mocks.writeConfigFile.mock.calls[0]?.[0]; |
| 67 | +const [call] = mocks.writeConfigFile.mock.calls; |
| 68 | +if (!call) { |
| 69 | +throw new Error("expected persisted config write"); |
| 70 | +} |
| 71 | +const [persistedCfg] = call; |
68 | 72 | if (!persistedCfg) { |
69 | 73 | throw new Error("expected persisted config"); |
70 | 74 | } |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。