






















@@ -66,6 +66,24 @@ describe("sendExecApprovalFollowupResult", () => {
6666resetExecApprovalFollowupRuntimeHandoffsForTests();
6767});
686869+function firstExecApprovalFollowupCall():
70+| {
71+internalRuntimeHandoffId?: string;
72+idempotencyKey?: string;
73+execApprovalFollowupToken?: string;
74+bashElevated?: unknown;
75+}
76+| undefined {
77+return sendExecApprovalFollowup.mock.calls[0]?.[0] as
78+| {
79+internalRuntimeHandoffId?: string;
80+idempotencyKey?: string;
81+execApprovalFollowupToken?: string;
82+bashElevated?: unknown;
83+}
84+| undefined;
85+}
86+6987it("logs repeated followup dispatch failures once per approval id and error message", async () => {
7088sendExecApprovalFollowup.mockRejectedValue(new Error("Channel is required"));
7189@@ -131,14 +149,7 @@ describe("sendExecApprovalFollowupResult", () => {
131149{ sendExecApprovalFollowup, logWarn },
132150);
133151134-const call = sendExecApprovalFollowup.mock.calls.at(0)?.[0] as
135-| {
136-internalRuntimeHandoffId?: string;
137-idempotencyKey?: string;
138-execApprovalFollowupToken?: string;
139-bashElevated?: unknown;
140-}
141-| undefined;
152+const call = firstExecApprovalFollowupCall();
142153if (!call) {
143154throw new Error("Expected elevated exec approval followup call");
144155}
@@ -186,13 +197,7 @@ describe("sendExecApprovalFollowupResult", () => {
186197{ sendExecApprovalFollowup, logWarn },
187198);
188199189-const call = sendExecApprovalFollowup.mock.calls.at(0)?.[0] as
190-| {
191-internalRuntimeHandoffId?: string;
192-idempotencyKey?: string;
193-bashElevated?: unknown;
194-}
195-| undefined;
200+const call = firstExecApprovalFollowupCall();
196201expect(call).not.toHaveProperty("internalRuntimeHandoffId");
197202expect(call).not.toHaveProperty("idempotencyKey");
198203expect(call).not.toHaveProperty("bashElevated");
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。