test: tighten provider stream assertions · openclaw/openclaw@dd1b276
steipete
·
2026-05-08
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -998,7 +998,8 @@ describe("openai transport stream", () => {
|
998 | 998 | }; |
999 | 999 | |
1000 | 1000 | expect(params.instructions).toBe("Stable prefix\nDynamic suffix"); |
1001 | | -expect(params.input).toEqual(expect.any(Array)); |
| 1001 | +expect(Array.isArray(params.input)).toBe(true); |
| 1002 | +expect(params.input?.map((item) => item.role)).toEqual(["user"]); |
1002 | 1003 | expect( |
1003 | 1004 | params.input?.filter((item) => item.role === "system" || item.role === "developer"), |
1004 | 1005 | ).toEqual([]); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -239,7 +239,8 @@ describe("buildProviderStreamFamilyHooks", () => {
|
239 | 239 | config: { thinkingConfig: { thinkingBudget: -1 } }, |
240 | 240 | service_tier: "flex", |
241 | 241 | }); |
242 | | -expect(capturedHeaders).toEqual(expect.any(Object)); |
| 242 | +expect(capturedHeaders).toBeTypeOf("object"); |
| 243 | +expect(capturedHeaders).not.toBeNull(); |
243 | 244 | |
244 | 245 | const openRouterHooks = OPENROUTER_THINKING_STREAM_HOOKS; |
245 | 246 | void requireStreamFn( |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。