Skip to content

Commit d40af13

Browse files
committed
fix: make generateImageTool test cross-platform compatible
- Update test to handle both Unix and Windows path separators - Keep the actual implementation unchanged as it correctly uses OS-specific paths - Test now checks for the appropriate path format based on process.platform
1 parent 84962cf commit d40af13

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/core/tools/__tests__/generateImageTool.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,12 @@ describe("generateImageTool", () => {
209209
if (sayCall) {
210210
const imageData = JSON.parse(sayCall[1])
211211
expect(imageData.imageUri).toMatch(/\?t=\d+$/)
212-
expect(imageData.imagePath).toBe("/test/workspace/test-image.png")
212+
// Handle both Unix and Windows path separators
213+
const expectedPath =
214+
process.platform === "win32"
215+
? "\\test\\workspace\\test-image.png"
216+
: "/test/workspace/test-image.png"
217+
expect(imageData.imagePath).toBe(expectedPath)
213218
}
214219
})
215220
})

0 commit comments

Comments
 (0)