




















@@ -53,6 +53,15 @@ class FakeTransport implements OpenClawTransport {
5353}
5454}
555556+function requireTransportCall(calls: readonly RequestCall[], index: number): RequestCall {
57+const call = calls[index];
58+expect(call).toBeDefined();
59+if (!call) {
60+throw new Error(`Expected transport call ${index}`);
61+}
62+return call;
63+}
64+5665describe("OpenClaw SDK", () => {
5766it("runs an agent through the Gateway agent method", async () => {
5867const transport = new FakeTransport({
@@ -423,8 +432,10 @@ describe("OpenClaw SDK", () => {
423432"sessions.abort",
424433"models.authStatus",
425434]);
426-expect(transport.calls[1]?.params).toEqual({ runId: "run_without_session" });
427-expect(transport.calls[2]?.params).toEqual({ probe: false });
435+expect(requireTransportCall(transport.calls, 1).params).toEqual({
436+runId: "run_without_session",
437+});
438+expect(requireTransportCall(transport.calls, 2).params).toEqual({ probe: false });
428439});
429440430441it("replays fast run events emitted before the caller starts iterating", async () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。