test: tighten runtime fetch formdata assertions · openclaw/openclaw@26a0de8
steipete
·
2026-05-11
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -94,18 +94,10 @@ describe("fetchWithRuntimeDispatcher", () => {
|
94 | 94 | // BodyInit and RuntimeFormData live in separate type namespaces so a double cast is needed. |
95 | 95 | const body = init?.body as unknown as RuntimeFormData; |
96 | 96 | expect(body).toBeInstanceOf(RuntimeFormData); |
97 | | -expect(body.records).toEqual( |
98 | | -expect.arrayContaining([ |
99 | | -expect.objectContaining({ |
100 | | -name: "model", |
101 | | -value: "gpt-4o-transcribe", |
102 | | -}), |
103 | | -expect.objectContaining({ |
104 | | -name: "file", |
105 | | -filename: "clip.ogg", |
106 | | -}), |
107 | | -]), |
108 | | -); |
| 97 | +const modelRecord = body.records.find((record) => record.name === "model"); |
| 98 | +expect(modelRecord?.value).toBe("gpt-4o-transcribe"); |
| 99 | +const fileRecord = body.records.find((record) => record.name === "file"); |
| 100 | +expect(fileRecord?.filename).toBe("clip.ogg"); |
109 | 101 | return new Response("ok", { status: 200 }); |
110 | 102 | }); |
111 | 103 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。