




















@@ -15,6 +15,13 @@ beforeAll(async () => {
15151616installProviderHttpMockCleanup();
171718+function requireRecord(value: unknown, label: string): Record<string, unknown> {
19+if (value === null || typeof value !== "object" || Array.isArray(value)) {
20+throw new Error(`expected ${label} to be a record`);
21+}
22+return value as Record<string, unknown>;
23+}
24+1825describe("together video generation provider", () => {
1926it("declares explicit mode capabilities", () => {
2027expectExplicitVideoGenerationCapabilities(buildTogetherVideoGenerationProvider());
@@ -51,21 +58,22 @@ describe("together video generation provider", () => {
5158cfg: {},
5259});
536054-expect(postJsonRequestMock).toHaveBeenCalledWith(
55-expect.objectContaining({
56-url: "https://api.together.xyz/v1/videos",
57-}),
58-);
61+expect(postJsonRequestMock).toHaveBeenCalledOnce();
62+const request = requireRecord(postJsonRequestMock.mock.calls[0]?.[0], "Together request");
63+expect(request.url).toBe("https://api.together.xyz/v1/videos");
64+const body = requireRecord(request.body, "Together request body");
65+expect(body.model).toBe("Wan-AI/Wan2.2-T2V-A14B");
66+expect(body.prompt).toBe("A bicycle weaving through a rainy neon street");
5967expect(result.videos).toHaveLength(1);
6068const [video] = result.videos;
6169if (!video) {
6270throw new Error("Expected generated Together video");
6371}
6472expect(video.fileName).toBe("video-1.webm");
65-expect(result.metadata).toEqual(
66-expect.objectContaining({
67- videoId: "video_123",
68-}),
69-);
73+expect(result.metadata).toEqual({
74+videoId: "video_123",
75+status: "completed",
76+videoUrl: "https://example.com/together.mp4",
77+});
7078});
7179});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。