mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-16 19:00:45 +00:00
test: tighten agent string assertions
This commit is contained in:
@@ -109,8 +109,8 @@ describe("buildApiErrorObservationFields", () => {
|
||||
`{"type":"error","error":{"type":"server_error","message":"${longMessage}"},"request_id":"req_long"}`,
|
||||
);
|
||||
|
||||
expect(observed.rawErrorPreview).toEqual(expect.any(String));
|
||||
expect(observed.providerErrorMessagePreview).toEqual(expect.any(String));
|
||||
expect(observed.rawErrorPreview).toBeTypeOf("string");
|
||||
expect(observed.providerErrorMessagePreview).toBeTypeOf("string");
|
||||
expect(observed.rawErrorPreview?.length).toBeLessThanOrEqual(401);
|
||||
expect(observed.providerErrorMessagePreview?.length).toBeLessThanOrEqual(201);
|
||||
expect(observed.providerErrorMessagePreview?.endsWith("…")).toBe(true);
|
||||
|
||||
@@ -17,9 +17,9 @@ describe("bundled taskflow skill frontmatter", () => {
|
||||
const raw = await fs.readFile(path.join(repoRoot, relativePath), "utf8");
|
||||
const frontmatter = parseFrontmatter(raw);
|
||||
|
||||
expect(frontmatter.name, relativePath).toEqual(expect.any(String));
|
||||
expect(frontmatter.name, relativePath).toBeTypeOf("string");
|
||||
expect(frontmatter.name.length, relativePath).toBeGreaterThan(0);
|
||||
expect(frontmatter.description, relativePath).toEqual(expect.any(String));
|
||||
expect(frontmatter.description, relativePath).toBeTypeOf("string");
|
||||
expect(frontmatter.description.length, relativePath).toBeGreaterThan(0);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user