We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b53c7dd commit 48f4957Copy full SHA for 48f4957
src/core/tools/__tests__/writeToFileTool.test.ts
@@ -141,6 +141,25 @@ describe("writeToFileTool", () => {
141
finalContent: "final content",
142
}),
143
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
163
}
164
mockCline.api = {
165
getModel: jest.fn().mockReturnValue({ id: "claude-3" }),
0 commit comments