File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/core/webview/__tests__ Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -860,7 +860,8 @@ describe("ClineProvider", () => {
860860 abortTask : jest . fn ( ) ,
861861 handleWebviewAskResponse : jest . fn ( ) ,
862862 } as unknown as Cline
863- provider . addClineToStack ( mockCline )
863+ const newMockCline = Object . create ( mockCline )
864+ provider . addClineToStack ( newMockCline )
864865
865866 // Mock getTaskWithId
866867 ; ( provider as any ) . getTaskWithId = jest . fn ( ) . mockResolvedValue ( {
@@ -872,15 +873,15 @@ describe("ClineProvider", () => {
872873 await messageHandler ( { type : "deleteMessage" , value : 4000 } )
873874
874875 // Verify correct messages were kept
875- expect ( mockCline . overwriteClineMessages ) . toHaveBeenCalledWith ( [
876+ expect ( newMockCline . overwriteClineMessages ) . toHaveBeenCalledWith ( [
876877 mockMessages [ 0 ] ,
877878 mockMessages [ 1 ] ,
878879 mockMessages [ 4 ] ,
879880 mockMessages [ 5 ] ,
880881 ] )
881882
882883 // Verify correct API messages were kept
883- expect ( mockCline . overwriteApiConversationHistory ) . toHaveBeenCalledWith ( [
884+ expect ( newMockCline . overwriteApiConversationHistory ) . toHaveBeenCalledWith ( [
884885 mockApiHistory [ 0 ] ,
885886 mockApiHistory [ 1 ] ,
886887 mockApiHistory [ 4 ] ,
You can’t perform that action at this time.
0 commit comments