






















@@ -34,6 +34,14 @@ vi.mock("../progress.js", () => ({
3434withProgress: (_opts: unknown, fn: () => unknown) => fn(),
3535}));
363637+function firstGatewayCall(): Record<string, unknown> {
38+const [callOpts] = callGatewaySpy.mock.calls[0] ?? [];
39+if (!callOpts) {
40+throw new Error("expected gateway call");
41+}
42+return callOpts;
43+}
44+3745describe("exec approval transport timeout (#12098)", () => {
3846const approvalTransportFloorMs = DEFAULT_EXEC_APPROVAL_TIMEOUT_MS + 10_000;
3947@@ -48,7 +56,7 @@ describe("exec approval transport timeout (#12098)", () => {
4856});
49575058expect(callGatewaySpy).toHaveBeenCalledTimes(1);
51-const callOpts = callGatewaySpy.mock.calls.at(0)![0];
59+const callOpts = firstGatewayCall();
5260expect(callOpts.method).toBe("exec.approval.request");
5361expect(callOpts.timeoutMs).toBe(35_000);
5462});
@@ -67,7 +75,7 @@ describe("exec approval transport timeout (#12098)", () => {
6775);
68766977expect(callGatewaySpy).toHaveBeenCalledTimes(1);
70-const callOpts = callGatewaySpy.mock.calls.at(0)![0];
78+const callOpts = firstGatewayCall();
7179expect(callOpts.timeoutMs).toBeGreaterThanOrEqual(approvalTimeoutMs);
7280expect(callOpts.timeoutMs).toBe(approvalTransportFloorMs);
7381});
@@ -89,7 +97,7 @@ describe("exec approval transport timeout (#12098)", () => {
8997{ transportTimeoutMs },
9098);
919992-const callOpts = callGatewaySpy.mock.calls.at(0)![0];
100+const callOpts = firstGatewayCall();
93101expect(callOpts.timeoutMs).toBe(approvalTransportFloorMs);
94102});
95103@@ -107,7 +115,7 @@ describe("exec approval transport timeout (#12098)", () => {
107115{ transportTimeoutMs },
108116);
109117110-const callOpts = callGatewaySpy.mock.calls.at(0)![0];
118+const callOpts = firstGatewayCall();
111119expect(callOpts.timeoutMs).toBe(approvalTransportFloorMs);
112120});
113121});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。