mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-06 08:18:39 +00:00
fix: add type guards for test assertions
This commit is contained in:
parent
1b5b6e6a20
commit
758f6d7e2b
1 changed files with 9 additions and 5 deletions
|
|
@ -86,11 +86,15 @@ describe("Image Mentions", () => {
|
|||
20, // maxTotalImageSize
|
||||
)
|
||||
|
||||
expect(result.text).toContain("'test/image.png' (see below for image)")
|
||||
expect(result.text).toContain('<image_content path="test/image.png">')
|
||||
expect(result.text).toContain("Image (500 KB)")
|
||||
expect(result.images).toHaveLength(1)
|
||||
expect(result.images[0]).toBe(mockImageDataUrl)
|
||||
// Type guard for TypeScript
|
||||
expect(typeof result).toBe("object")
|
||||
if (typeof result === "object") {
|
||||
expect(result.text).toContain("'test/image.png' (see below for image)")
|
||||
expect(result.text).toContain('<image_content path="test/image.png">')
|
||||
expect(result.text).toContain("Image (500 KB)")
|
||||
expect(result.images).toHaveLength(1)
|
||||
expect(result.images[0]).toBe(mockImageDataUrl)
|
||||
}
|
||||
})
|
||||
|
||||
it("should handle multiple image mentions", async () => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue