

























@@ -105,7 +105,7 @@ function createConfigWithDiscordAccount(overrides: Record<string, unknown> = {})
105105type MockCallReader = { mock: { calls: unknown[][] } };
106106107107function firstMockArg(mock: MockCallReader, label: string) {
108-const firstCall = mock.mock.calls.at(0);
108+const firstCall = mock.mock.calls[0];
109109if (!firstCall) {
110110throw new Error(`expected ${label} mock call`);
111111}
@@ -183,10 +183,10 @@ describe("monitorDiscordProvider", () => {
183183184184const getHealthProbe = () => {
185185expect(reconcileAcpThreadBindingsOnStartupMock).toHaveBeenCalledTimes(1);
186-const firstCall = reconcileAcpThreadBindingsOnStartupMock.mock.calls.at(0) as
187-| [ReconcileStartupParams]
188-| undefined;
189-const reconcileParams = firstCall?.[0];
186+const reconcileParams = firstMockArg(
187+reconcileAcpThreadBindingsOnStartupMock,
188+"ACP startup reconciliation",
189+) as ReconcileStartupParams;
190190if (!reconcileParams?.healthProbe) {
191191throw new Error("healthProbe was not wired into ACP startup reconciliation");
192192}
@@ -198,8 +198,7 @@ describe("monitorDiscordProvider", () => {
198198gatewayRuntimeReadyTimeoutMs?: number;
199199} => {
200200expect(monitorLifecycleMock).toHaveBeenCalledTimes(1);
201-const firstCall = monitorLifecycleMock.mock.calls.at(0);
202-const params = firstCall?.[0] as
201+const params = firstMockArg(monitorLifecycleMock, "Discord lifecycle monitor") as
203202| { gatewayReadyTimeoutMs?: number; gatewayRuntimeReadyTimeoutMs?: number }
204203| undefined;
205204if (!params) {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。