test: tighten live provider assertions · openclaw/openclaw@f647614
steipete
·
2026-05-08
·
via Recent Commits to openclaw:main
File tree
extensions/browser/src/browser
| Original file line number | Diff line number | Diff line change |
|---|
@@ -18,7 +18,8 @@ describeLive("browser (live): remote CDP tab persistence", () => {
|
18 | 18 | await pw.closePlaywrightBrowserConnection().catch(() => {}); |
19 | 19 | |
20 | 20 | const created = await pw.createPageViaPlaywright({ cdpUrl: CDP_URL, url: "about:blank" }); |
21 | | -expect(created.targetId).toEqual(expect.any(String)); |
| 21 | +expect(created.targetId).toBeTypeOf("string"); |
| 22 | +expect(created.targetId).not.toBe(""); |
22 | 23 | try { |
23 | 24 | await waitFor( |
24 | 25 | async () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -59,8 +59,8 @@ describeLive("pi embedded extra params (live)", () => {
|
59 | 59 | } |
60 | 60 | } |
61 | 61 | |
62 | | -expect(stopReason).toEqual(expect.any(String)); |
63 | | -expect(outputTokens).toEqual(expect.any(Number)); |
| 62 | +expect(stopReason).toBeTypeOf("string"); |
| 63 | +expect(outputTokens).toBeTypeOf("number"); |
64 | 64 | // Should respect maxTokens from config (16) — allow a small buffer for provider rounding. |
65 | 65 | expect(outputTokens ?? 0).toBeLessThanOrEqual(20); |
66 | 66 | }, 30_000); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -119,7 +119,7 @@ describeLive("xai live", () => {
|
119 | 119 | const doneMessage = await collectDoneMessage( |
120 | 120 | stream as AsyncIterable<{ type: string; message?: AssistantLikeMessage }>, |
121 | 121 | ); |
122 | | -expect(doneMessage.content).toEqual(expect.any(Array)); |
| 122 | +expect(Array.isArray(doneMessage.content)).toBe(true); |
123 | 123 | const payload = requireLiveValue(capturedPayload, "captured xAI payload"); |
124 | 124 | if ("tool_stream" in payload) { |
125 | 125 | expect(payload.tool_stream).toBe(true); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。