@@ -94,18 +94,8 @@ describe("attemptCompletionTool - DISABLE_COMPLETION_COMMAND experiment", () =>
9494 )
9595
9696 // When there's a lastMessage that's not a command ask, it should say completion_result first
97- expect ( mockCline . say ) . toHaveBeenCalledWith (
98- "completion_result" ,
99- "Task completed successfully" ,
100- undefined ,
101- false ,
102- )
103- expect ( mockCline . emit ) . toHaveBeenCalledWith (
104- "taskCompleted" ,
105- mockCline . taskId ,
106- expect . any ( Object ) ,
107- expect . any ( Object ) ,
108- )
97+ expect ( mockCline . say ) . toHaveBeenCalledWith ( "completion_result" , "Task completed successfully" , undefined , false )
98+ expect ( mockCline . emit ) . toHaveBeenCalledWith ( "taskCompleted" , mockCline . taskId , expect . any ( Object ) , expect . any ( Object ) )
10999 expect ( mockAskApproval ) . toHaveBeenCalledWith ( "command" , "npm test" )
110100 expect ( mockExecuteCommand ) . toHaveBeenCalled ( )
111101 } )
@@ -137,18 +127,8 @@ describe("attemptCompletionTool - DISABLE_COMPLETION_COMMAND experiment", () =>
137127 )
138128
139129 // Should say completion_result and emit before asking for approval
140- expect ( mockCline . say ) . toHaveBeenCalledWith (
141- "completion_result" ,
142- "Task completed successfully" ,
143- undefined ,
144- false ,
145- )
146- expect ( mockCline . emit ) . toHaveBeenCalledWith (
147- "taskCompleted" ,
148- mockCline . taskId ,
149- expect . any ( Object ) ,
150- expect . any ( Object ) ,
151- )
130+ expect ( mockCline . say ) . toHaveBeenCalledWith ( "completion_result" , "Task completed successfully" , undefined , false )
131+ expect ( mockCline . emit ) . toHaveBeenCalledWith ( "taskCompleted" , mockCline . taskId , expect . any ( Object ) , expect . any ( Object ) )
152132 expect ( mockAskApproval ) . toHaveBeenCalledWith ( "command" , "npm test" )
153133 expect ( mockExecuteCommand ) . not . toHaveBeenCalled ( )
154134 } )
@@ -185,12 +165,7 @@ describe("attemptCompletionTool - DISABLE_COMPLETION_COMMAND experiment", () =>
185165 mockAskFinishSubTaskApproval ,
186166 )
187167
188- expect ( mockCline . say ) . toHaveBeenCalledWith (
189- "completion_result" ,
190- "Task completed successfully" ,
191- undefined ,
192- false ,
193- )
168+ expect ( mockCline . say ) . toHaveBeenCalledWith ( "completion_result" , "Task completed successfully" , undefined , false )
194169 expect ( mockAskApproval ) . not . toHaveBeenCalled ( )
195170 expect ( mockExecuteCommand ) . not . toHaveBeenCalled ( )
196171 } )
@@ -215,18 +190,8 @@ describe("attemptCompletionTool - DISABLE_COMPLETION_COMMAND experiment", () =>
215190 mockAskFinishSubTaskApproval ,
216191 )
217192
218- expect ( mockCline . say ) . toHaveBeenCalledWith (
219- "completion_result" ,
220- "Task completed successfully" ,
221- undefined ,
222- false ,
223- )
224- expect ( mockCline . emit ) . toHaveBeenCalledWith (
225- "taskCompleted" ,
226- mockCline . taskId ,
227- expect . any ( Object ) ,
228- expect . any ( Object ) ,
229- )
193+ expect ( mockCline . say ) . toHaveBeenCalledWith ( "completion_result" , "Task completed successfully" , undefined , false )
194+ expect ( mockCline . emit ) . toHaveBeenCalledWith ( "taskCompleted" , mockCline . taskId , expect . any ( Object ) , expect . any ( Object ) )
230195 expect ( mockAskApproval ) . not . toHaveBeenCalled ( )
231196 } )
232197 } )
@@ -258,12 +223,7 @@ describe("attemptCompletionTool - DISABLE_COMPLETION_COMMAND experiment", () =>
258223 mockAskFinishSubTaskApproval ,
259224 )
260225
261- expect ( mockCline . say ) . toHaveBeenCalledWith (
262- "completion_result" ,
263- "Task completed successfully" ,
264- undefined ,
265- false ,
266- )
226+ expect ( mockCline . say ) . toHaveBeenCalledWith ( "completion_result" , "Task completed successfully" , undefined , false )
267227 expect ( mockAskApproval ) . not . toHaveBeenCalled ( )
268228
269229 // Reset mocks
@@ -287,12 +247,7 @@ describe("attemptCompletionTool - DISABLE_COMPLETION_COMMAND experiment", () =>
287247 mockAskFinishSubTaskApproval ,
288248 )
289249
290- expect ( mockCline . say ) . toHaveBeenCalledWith (
291- "completion_result" ,
292- "Task completed successfully" ,
293- undefined ,
294- false ,
295- )
250+ expect ( mockCline . say ) . toHaveBeenCalledWith ( "completion_result" , "Task completed successfully" , undefined , false )
296251 expect ( mockAskApproval ) . not . toHaveBeenCalled ( )
297252 } )
298253 } )
@@ -352,4 +307,4 @@ describe("attemptCompletionTool - DISABLE_COMPLETION_COMMAND experiment", () =>
352307 expect ( mockCline . say ) . not . toHaveBeenCalled ( )
353308 } )
354309 } )
355- } )
310+ } )
0 commit comments