test: guard gateway register mock calls · openclaw/openclaw@5a432aa
steipete
·
2026-05-12
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -146,7 +146,7 @@ describe("gateway register option collisions", () => {
|
146 | 146 | argv: ["gateway", "call", "health", "--token", "tok_call", "--json"], |
147 | 147 | assert: () => { |
148 | 148 | expect(callGatewayCli).toHaveBeenCalledTimes(1); |
149 | | -const [method, opts, params] = callGatewayCli.mock.calls[0] ?? []; |
| 149 | +const [method, opts, params] = callGatewayCli.mock.calls.at(0) ?? []; |
150 | 150 | expect(method).toBe("health"); |
151 | 151 | expect((opts as { token?: string } | undefined)?.token).toBe("tok_call"); |
152 | 152 | expect(params).toEqual({}); |
@@ -157,7 +157,7 @@ describe("gateway register option collisions", () => {
|
157 | 157 | argv: ["gateway", "probe", "--token", "tok_probe", "--json"], |
158 | 158 | assert: () => { |
159 | 159 | expect(gatewayStatusCommand).toHaveBeenCalledTimes(1); |
160 | | -const [opts, runtime] = gatewayStatusCommand.mock.calls[0] ?? []; |
| 160 | +const [opts, runtime] = gatewayStatusCommand.mock.calls.at(0) ?? []; |
161 | 161 | expect((opts as { token?: string } | undefined)?.token).toBe("tok_probe"); |
162 | 162 | expect(runtime).toBe(defaultRuntime); |
163 | 163 | }, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。