




















@@ -153,12 +153,10 @@ describe("createChannelApprovalHandlerFromCapability", () => {
153153await approvalRuntime.handleRequested(request);
154154await approvalRuntime.stop();
155155156-expect(unbindPending).toHaveBeenCalledWith(
157-expect.objectContaining({
158- request,
159-approvalKind: "plugin",
160-}),
161-);
156+expect(unbindPending).toHaveBeenCalledOnce();
157+const stopUnbind = unbindPending.mock.calls[0]?.[0];
158+expect(stopUnbind?.request).toBe(request);
159+expect(stopUnbind?.approvalKind).toBe("plugin");
162160});
163161164162it("ignores duplicate pending request ids before finalization", async () => {
@@ -185,13 +183,10 @@ describe("createChannelApprovalHandlerFromCapability", () => {
185183} as never);
186184187185expect(unbindPending).toHaveBeenCalledTimes(1);
188-expect(unbindPending).toHaveBeenCalledWith(
189-expect.objectContaining({
190-entry: { messageId: "1" },
191-binding: { bindingId: "bound-1" },
192- request,
193-}),
194-);
186+const unbind = unbindPending.mock.calls[0]?.[0];
187+expect(unbind?.entry).toEqual({ messageId: "1" });
188+expect(unbind?.binding).toEqual({ bindingId: "bound-1" });
189+expect(unbind?.request).toBe(request);
195190expect(buildResolvedResult).toHaveBeenCalledTimes(1);
196191});
197192@@ -231,11 +226,7 @@ describe("createChannelApprovalHandlerFromCapability", () => {
231226232227expect(unbindPending).toHaveBeenCalledTimes(2);
233228expect(buildResolvedResult).toHaveBeenCalledTimes(1);
234-expect(buildResolvedResult).toHaveBeenCalledWith(
235-expect.objectContaining({
236-entry: { messageId: "2" },
237-}),
238-);
229+expect(buildResolvedResult.mock.calls[0]?.[0]?.entry).toEqual({ messageId: "2" });
239230});
240231241232it("continues stop-time unbind cleanup when one binding throws", async () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。