File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
packages/subagents/src/explorer/__tests__ Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -624,6 +624,9 @@ describe('ExplorerAgent', () => {
624624 // Close the indexer to cause an error
625625 await indexer . close ( ) ;
626626
627+ // Mock the logger to suppress expected error output
628+ const errorSpy = vi . spyOn ( context . logger , 'error' ) . mockImplementation ( ( ) => { } ) ;
629+
627630 const message : Message = {
628631 id : 'msg-error-1' ,
629632 type : 'request' ,
@@ -642,8 +645,10 @@ describe('ExplorerAgent', () => {
642645 expect ( response ) . toBeDefined ( ) ;
643646 expect ( response ?. type ) . toBe ( 'error' ) ;
644647 expect ( response ?. payload ) . toHaveProperty ( 'error' ) ;
648+ expect ( errorSpy ) . toHaveBeenCalled ( ) ;
645649
646- // Reinitialize for other tests
650+ // Restore logger and reinitialize for other tests
651+ errorSpy . mockRestore ( ) ;
647652 await indexer . initialize ( ) ;
648653 await indexer . index ( ) ;
649654 } ) ;
You can’t perform that action at this time.
0 commit comments