test: clarify live loose boolean assertions

This commit is contained in:
Peter Steinberger
2026-05-08 14:05:55 +01:00
parent f2c813cb31
commit be28fdcb60
2 changed files with 3 additions and 2 deletions

View File

@@ -130,7 +130,8 @@ describeLive("xai live", () => {
: [];
expect(payloadTools.length).toBeGreaterThan(0);
const firstFunction = payloadTools[0]?.function;
expect(firstFunction && typeof firstFunction === "object").toBe(true);
expect(firstFunction).not.toBeNull();
expect(typeof firstFunction).toBe("object");
expect([undefined, false]).toContain((firstFunction as Record<string, unknown>).strict);
});
}, 90_000);

View File

@@ -238,7 +238,7 @@ const COMMAND_PROFILES: Record<string, CommandProfile> = {
outcome: "success",
onSuccess: (payload) => {
const obj = assertObjectPayload("sms.search", payload);
expect(typeof obj.count === "number" || typeof obj.count === "string").toBe(true);
expect(["number", "string"]).toContain(typeof obj.count);
expect(Array.isArray(obj.messages)).toBe(true);
},
},