























@@ -89,7 +89,7 @@ function expectFields(value: unknown, expected: Record<string, unknown>): void {
8989}
90909191function readFirstCallArg(mock: ReturnType<typeof vi.fn>): Record<string, unknown> {
92-const [arg] = mock.mock.calls[0] ?? [];
92+const [arg] = mock.mock.calls.at(0) ?? [];
9393if (!arg || typeof arg !== "object") {
9494throw new Error("expected first call argument object");
9595}
@@ -223,7 +223,7 @@ describe("channel-auth", () => {
223223await runChannelLogin({ channel: "whatsapp", account: "acct-1" }, runtime);
224224225225expect(mocks.callGateway).not.toHaveBeenCalled();
226-expect(String(runtime.log.mock.calls[0]?.[0])).toContain("Gateway is in remote mode");
226+expect(String(runtime.log.mock.calls.at(0)?.[0])).toContain("Gateway is in remote mode");
227227});
228228229229it("keeps login successful when local gateway runtime reconcile fails", async () => {
@@ -233,7 +233,7 @@ describe("channel-auth", () => {
233233runChannelLogin({ channel: "whatsapp", account: "acct-1" }, runtime),
234234).resolves.toBeUndefined();
235235236-expect(String(runtime.log.mock.calls[0]?.[0])).toContain(
236+expect(String(runtime.log.mock.calls.at(0)?.[0])).toContain(
237237"running gateway did not restart it: gateway unreachable",
238238);
239239});
@@ -565,7 +565,7 @@ describe("channel-auth", () => {
565565account: { id: "resolved-account" },
566566 runtime,
567567});
568-expect(String(runtime.log.mock.calls[0]?.[0])).toContain(
568+expect(String(runtime.log.mock.calls.at(0)?.[0])).toContain(
569569"running gateway did not stop it: gateway unreachable",
570570);
571571expect(mocks.setVerbose).not.toHaveBeenCalled();
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。