@@ -19,7 +19,6 @@ describe('Git CLI', () => {
1919 const execMock = jest . spyOn ( exec , 'exec' ) . mockResolvedValue ( 0 )
2020
2121 await switchBranch ( 'new-branch' )
22- expect ( execMock ) . toHaveBeenCalled ( )
2322 expect ( execMock ) . toHaveBeenCalledWith (
2423 'git' ,
2524 [ 'checkout' , '-b' , 'new-branch' ] ,
@@ -97,7 +96,6 @@ describe('Git CLI', () => {
9796 . mockReturnValue ( false )
9897
9998 await pushCurrentBranch ( )
100- expect ( execMock ) . toHaveBeenCalled ( )
10199 expect ( execMock ) . toHaveBeenCalledWith (
102100 'git' ,
103101 [ 'push' , '--porcelain' , '--set-upstream' , 'origin' , 'HEAD' ] ,
@@ -190,7 +188,6 @@ describe('Git CLI', () => {
190188 const execMock = jest . spyOn ( exec , 'exec' ) . mockResolvedValue ( 0 )
191189
192190 await addFileChanges ( [ '*.ts' , '~/.bashrc' ] )
193- expect ( execMock ) . toHaveBeenCalled ( )
194191 expect ( execMock ) . toHaveBeenCalledWith (
195192 'git' ,
196193 [ 'add' , '--' , '/test-workspace/*.ts' , '/test-workspace/~/.bashrc' ] ,
@@ -284,7 +281,13 @@ describe('Git CLI', () => {
284281 } )
285282
286283 const changes = await getFileChanges ( )
287- expect ( execMock ) . toHaveBeenCalled ( )
284+ expect ( execMock ) . toHaveBeenCalledWith (
285+ 'git' ,
286+ [ 'status' , '-suno' , '--porcelain' ] ,
287+ expect . objectContaining ( {
288+ listeners : { stdline : expect . anything ( ) , errline : expect . anything ( ) } ,
289+ } )
290+ )
288291 expect ( changes ) . toBeDefined ( )
289292 expect ( changes . additions ) . toBeDefined ( )
290293 expect ( changes . additions ) . toHaveLength ( 5 )
0 commit comments