diff --git a/src/core/tools/__tests__/insertContentTool.spec.ts b/src/core/tools/__tests__/insertContentTool.spec.ts index c980ee17ec..dc8edf0a83 100644 --- a/src/core/tools/__tests__/insertContentTool.spec.ts +++ b/src/core/tools/__tests__/insertContentTool.spec.ts @@ -71,6 +71,14 @@ describe("insertContentTool", () => { cwd: "/", consecutiveMistakeCount: 0, didEditFile: false, + providerRef: { + deref: vi.fn().mockReturnValue({ + getState: vi.fn().mockResolvedValue({ + diagnosticsEnabled: true, + diagnosticsDelayMs: 2000, + }), + }), + }, rooIgnoreController: { validateAccess: vi.fn().mockReturnValue(true), }, diff --git a/src/core/tools/__tests__/writeToFileTool.spec.ts b/src/core/tools/__tests__/writeToFileTool.spec.ts index f223d4b0fc..4b6a782fd5 100644 --- a/src/core/tools/__tests__/writeToFileTool.spec.ts +++ b/src/core/tools/__tests__/writeToFileTool.spec.ts @@ -132,6 +132,14 @@ describe("writeToFileTool", () => { mockCline.consecutiveMistakeCount = 0 mockCline.didEditFile = false mockCline.diffStrategy = undefined + mockCline.providerRef = { + deref: vi.fn().mockReturnValue({ + getState: vi.fn().mockResolvedValue({ + diagnosticsEnabled: true, + diagnosticsDelayMs: 2000, + }), + }), + } mockCline.rooIgnoreController = { validateAccess: vi.fn().mockReturnValue(true), } @@ -376,7 +384,7 @@ describe("writeToFileTool", () => { userEdits: userEditsValue, finalContent: "modified content", }) - // Manually set the property on the mock instance because the original saveChanges is not called + // Set the userEdits property on the diffViewProvider mock to simulate user edits mockCline.diffViewProvider.userEdits = userEditsValue await executeWriteFileTool({}, { fileExists: true })