Skip to content

Commit 10e8e20

Browse files
committed
fix: make insertContentTool test platform-agnostic for Windows CI
1 parent 94cfdf6 commit 10e8e20

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/core/tools/__tests__/insertContentTool.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ vi.mock("path", async () => {
1212
const originalPath = await vi.importActual("path")
1313
return {
1414
...originalPath,
15-
resolve: vi.fn().mockImplementation((...args) => args.join("/")),
15+
resolve: vi.fn(),
1616
}
1717
})
1818

@@ -54,6 +54,7 @@ vi.mock("../../ignore/RooIgnoreController", () => ({
5454

5555
describe("insertContentTool", () => {
5656
const testFilePath = "test/file.txt"
57+
// Use a consistent mock absolute path for testing
5758
const absoluteFilePath = "/test/file.txt"
5859

5960
const mockedFileExistsAtPath = fileExistsAtPath as MockedFunction<typeof fileExistsAtPath>
@@ -70,6 +71,7 @@ describe("insertContentTool", () => {
7071
beforeEach(() => {
7172
vi.clearAllMocks()
7273

74+
// Mock path.resolve to return our test absolute path
7375
mockedPathResolve.mockReturnValue(absoluteFilePath)
7476
mockedFileExistsAtPath.mockResolvedValue(true) // Assume file exists by default for insert
7577
mockedFsReadFile.mockResolvedValue("") // Default empty file content

0 commit comments

Comments
 (0)