mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 19:10:42 +00:00
test: tighten live provider assertions
This commit is contained in:
@@ -18,7 +18,8 @@ describeLive("browser (live): remote CDP tab persistence", () => {
|
||||
await pw.closePlaywrightBrowserConnection().catch(() => {});
|
||||
|
||||
const created = await pw.createPageViaPlaywright({ cdpUrl: CDP_URL, url: "about:blank" });
|
||||
expect(created.targetId).toEqual(expect.any(String));
|
||||
expect(created.targetId).toBeTypeOf("string");
|
||||
expect(created.targetId).not.toBe("");
|
||||
try {
|
||||
await waitFor(
|
||||
async () => {
|
||||
|
||||
@@ -59,8 +59,8 @@ describeLive("pi embedded extra params (live)", () => {
|
||||
}
|
||||
}
|
||||
|
||||
expect(stopReason).toEqual(expect.any(String));
|
||||
expect(outputTokens).toEqual(expect.any(Number));
|
||||
expect(stopReason).toBeTypeOf("string");
|
||||
expect(outputTokens).toBeTypeOf("number");
|
||||
// Should respect maxTokens from config (16) — allow a small buffer for provider rounding.
|
||||
expect(outputTokens ?? 0).toBeLessThanOrEqual(20);
|
||||
}, 30_000);
|
||||
|
||||
@@ -119,7 +119,7 @@ describeLive("xai live", () => {
|
||||
const doneMessage = await collectDoneMessage(
|
||||
stream as AsyncIterable<{ type: string; message?: AssistantLikeMessage }>,
|
||||
);
|
||||
expect(doneMessage.content).toEqual(expect.any(Array));
|
||||
expect(Array.isArray(doneMessage.content)).toBe(true);
|
||||
const payload = requireLiveValue(capturedPayload, "captured xAI payload");
|
||||
if ("tool_stream" in payload) {
|
||||
expect(payload.tool_stream).toBe(true);
|
||||
|
||||
Reference in New Issue
Block a user