Skip to content

Commit 48f4957

Browse files
committed
fix tests
1 parent b53c7dd commit 48f4957

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,25 @@ describe("writeToFileTool", () => {
141141
finalContent: "final content",
142142
}),
143143
scrollToFirstDiff: jest.fn(),
144+
pushToolWriteResult: jest.fn().mockImplementation(async function (
145+
this: any,
146+
task: any,
147+
cwd: string,
148+
isNewFile: boolean,
149+
) {
150+
// Simulate the behavior of pushToolWriteResult
151+
if (this.userEdits) {
152+
await task.say(
153+
"user_feedback_diff",
154+
JSON.stringify({
155+
tool: isNewFile ? "newFileCreated" : "editedExistingFile",
156+
path: "test/path.txt",
157+
diff: this.userEdits,
158+
}),
159+
)
160+
}
161+
return "Tool result message"
162+
}),
144163
}
145164
mockCline.api = {
146165
getModel: jest.fn().mockReturnValue({ id: "claude-3" }),

0 commit comments

Comments
 (0)