@@ -22,7 +22,7 @@ const mockAskApproval = vi.fn<AskApproval>()
2222const mockHandleError = vi . fn < HandleError > ( )
2323const mockPushToolResult = vi . fn ( )
2424const mockRemoveClosingTag = vi . fn ( ( _name : string , value : string | undefined ) => value ?? "" )
25- const mockInitClineWithTask = vi . fn < ( ) => Promise < MockClineInstance > > ( ) . mockResolvedValue ( { taskId : "mock-subtask-id" } )
25+ const mockCreateTask = vi . fn < ( ) => Promise < MockClineInstance > > ( ) . mockResolvedValue ( { taskId : "mock-subtask-id" } )
2626const mockEmit = vi . fn ( )
2727const mockRecordToolError = vi . fn ( )
2828const mockSayAndCreateMissingParamError = vi . fn ( )
@@ -40,7 +40,7 @@ const mockCline = {
4040 deref : vi . fn ( ( ) => ( {
4141 getState : vi . fn ( ( ) => ( { customModes : [ ] , mode : "ask" } ) ) ,
4242 handleModeSwitch : vi . fn ( ) ,
43- initClineWithTask : mockInitClineWithTask ,
43+ createTask : mockCreateTask ,
4444 } ) ) ,
4545 } ,
4646}
@@ -88,8 +88,8 @@ describe("newTaskTool", () => {
8888 // Verify askApproval was called
8989 expect ( mockAskApproval ) . toHaveBeenCalled ( )
9090
91- // Verify the message passed to initClineWithTask reflects the code's behavior in unit tests
92- expect ( mockInitClineWithTask ) . toHaveBeenCalledWith (
91+ // Verify the message passed to createTask reflects the code's behavior in unit tests
92+ expect ( mockCreateTask ) . toHaveBeenCalledWith (
9393 "Review this: \\@file1.txt and also \\\\\\@file2.txt" , // Unit Test Expectation: \\@ -> \@, \\\\@ -> \\\\@
9494 undefined ,
9595 mockCline ,
@@ -122,7 +122,7 @@ describe("newTaskTool", () => {
122122 mockRemoveClosingTag ,
123123 )
124124
125- expect ( mockInitClineWithTask ) . toHaveBeenCalledWith (
125+ expect ( mockCreateTask ) . toHaveBeenCalledWith (
126126 "This is already unescaped: \\@file1.txt" , // Expected: \@ remains \@
127127 undefined ,
128128 mockCline ,
@@ -149,7 +149,7 @@ describe("newTaskTool", () => {
149149 mockRemoveClosingTag ,
150150 )
151151
152- expect ( mockInitClineWithTask ) . toHaveBeenCalledWith (
152+ expect ( mockCreateTask ) . toHaveBeenCalledWith (
153153 "A normal mention @file1.txt" , // Expected: @ remains @
154154 undefined ,
155155 mockCline ,
@@ -176,7 +176,7 @@ describe("newTaskTool", () => {
176176 mockRemoveClosingTag ,
177177 )
178178
179- expect ( mockInitClineWithTask ) . toHaveBeenCalledWith (
179+ expect ( mockCreateTask ) . toHaveBeenCalledWith (
180180 "Mix: @file0.txt, \\@file1.txt, \\@file2.txt, \\\\\\@file3.txt" , // Unit Test Expectation: @->@, \@->\@, \\@->\@, \\\\@->\\\\@
181181 undefined ,
182182 mockCline ,
0 commit comments