@@ -41,6 +41,21 @@ function mockSuccessfulBytePlusTask(params?: { model?: string }) {
|
41 | 41 | }); |
42 | 42 | } |
43 | 43 | |
| 44 | +function requireBytePlusPostBody(): Record<string, unknown> { |
| 45 | +const request = postJsonRequestMock.mock.calls[0]?.[0] as |
| 46 | +| { body?: Record<string, unknown> } |
| 47 | +| undefined; |
| 48 | +expect(request).toBeDefined(); |
| 49 | +if (!request) { |
| 50 | +throw new Error("expected BytePlus video request"); |
| 51 | +} |
| 52 | +expect(request.body).toBeDefined(); |
| 53 | +if (!request.body) { |
| 54 | +throw new Error("expected BytePlus video request body"); |
| 55 | +} |
| 56 | +return request.body; |
| 57 | +} |
| 58 | + |
44 | 59 | describe("byteplus video generation provider", () => { |
45 | 60 | it("declares explicit mode capabilities", () => { |
46 | 61 | expectExplicitVideoGenerationCapabilities(buildBytePlusVideoGenerationProvider()); |
@@ -88,8 +103,7 @@ describe("byteplus video generation provider", () => {
|
88 | 103 | cfg: {}, |
89 | 104 | }); |
90 | 105 | |
91 | | -const request = postJsonRequestMock.mock.calls[0]?.[0] as { body?: Record<string, unknown> }; |
92 | | -expect(request.body).toMatchObject({ |
| 106 | +expect(requireBytePlusPostBody()).toMatchObject({ |
93 | 107 | model: "seedance-1-0-lite-i2v-250428", |
94 | 108 | resolution: "720p", |
95 | 109 | content: [ |
@@ -119,8 +133,7 @@ describe("byteplus video generation provider", () => {
|
119 | 133 | cfg: {}, |
120 | 134 | }); |
121 | 135 | |
122 | | -const request = postJsonRequestMock.mock.calls[0]?.[0] as { body?: Record<string, unknown> }; |
123 | | -expect(request.body).toMatchObject({ |
| 136 | +expect(requireBytePlusPostBody()).toMatchObject({ |
124 | 137 | model: "seedance-1-0-pro-250528", |
125 | 138 | seed: 42, |
126 | 139 | resolution: "480p", |
|