





























@@ -417,7 +417,7 @@ describe("capability cli", () => {
417417};
418418419419function firstGatewayCall() {
420-return mocks.callGateway.mock.calls[0]?.[0] as GatewayCall | undefined;
420+return mocks.callGateway.mock.calls.at(0)?.[0] as GatewayCall | undefined;
421421}
422422423423function firstCompletionCall() {
@@ -435,7 +435,7 @@ describe("capability cli", () => {
435435}
436436437437function firstJsonOutput() {
438-return mocks.runtime.writeJson.mock.calls[0]?.[0] as Record<string, unknown> | undefined;
438+return mocks.runtime.writeJson.mock.calls.at(0)?.[0] as Record<string, unknown> | undefined;
439439}
440440441441function imageDescribeCall(index = 0) {
@@ -505,7 +505,7 @@ describe("capability cli", () => {
505505argv: ["capability", "list", "--json"],
506506});
507507508-const payload = mocks.runtime.writeJson.mock.calls[0]?.[0] as Array<{ id: string }>;
508+const payload = (firstJsonOutput() as Array<{ id: string }> | undefined) ?? [];
509509const ids = payload.map((entry) => entry.id);
510510expect(ids).toContain("model.run");
511511expect(ids).toContain("image.describe");
@@ -1524,7 +1524,7 @@ describe("capability cli", () => {
15241524});
1525152515261526const outputPath = `${outputBase}.mp4`;
1527-const fetchCall = fetchMock.mock.calls[0] as unknown as
1527+const fetchCall = fetchMock.mock.calls.at(0) as unknown as
15281528| [string, { signal?: unknown }]
15291529| undefined;
15301530expect(fetchCall?.[0]).toBe("https://example.com/generated-video.mp4");
@@ -1982,7 +1982,7 @@ describe("capability cli", () => {
19821982argv: ["capability", "embedding", "providers", "--json"],
19831983});
198419841985-const bootstrapArg = mocks.registerBuiltInMemoryEmbeddingProviders.mock.calls[0]?.[0] as
1985+const bootstrapArg = mocks.registerBuiltInMemoryEmbeddingProviders.mock.calls.at(0)?.[0] as
19861986| { registerMemoryEmbeddingProvider?: unknown }
19871987| undefined;
19881988expect(typeof bootstrapArg?.registerMemoryEmbeddingProvider).toBe("function");
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。