mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-08 22:21:23 +00:00
fix: make insertContentTool test platform-agnostic for Windows CI
This commit is contained in:
parent
94cfdf622f
commit
10e8e203f7
1 changed files with 3 additions and 1 deletions
|
|
@ -12,7 +12,7 @@ vi.mock("path", async () => {
|
|||
const originalPath = await vi.importActual("path")
|
||||
return {
|
||||
...originalPath,
|
||||
resolve: vi.fn().mockImplementation((...args) => args.join("/")),
|
||||
resolve: vi.fn(),
|
||||
}
|
||||
})
|
||||
|
||||
|
|
@ -54,6 +54,7 @@ vi.mock("../../ignore/RooIgnoreController", () => ({
|
|||
|
||||
describe("insertContentTool", () => {
|
||||
const testFilePath = "test/file.txt"
|
||||
// Use a consistent mock absolute path for testing
|
||||
const absoluteFilePath = "/test/file.txt"
|
||||
|
||||
const mockedFileExistsAtPath = fileExistsAtPath as MockedFunction<typeof fileExistsAtPath>
|
||||
|
|
@ -70,6 +71,7 @@ describe("insertContentTool", () => {
|
|||
beforeEach(() => {
|
||||
vi.clearAllMocks()
|
||||
|
||||
// Mock path.resolve to return our test absolute path
|
||||
mockedPathResolve.mockReturnValue(absoluteFilePath)
|
||||
mockedFileExistsAtPath.mockResolvedValue(true) // Assume file exists by default for insert
|
||||
mockedFsReadFile.mockResolvedValue("") // Default empty file content
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue