File tree Expand file tree Collapse file tree 1 file changed +8
-12
lines changed
cli/src/__tests__/integration Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -687,7 +687,7 @@ describe('Local Agent Integration', () => {
687687 expect ( message ) . toContain ( 'Message Test Agent' )
688688 } )
689689
690- test ( 'announceLoadedAgents logs to console ' , async ( ) => {
690+ test ( 'announceLoadedAgents logs agent information ' , async ( ) => {
691691 mkdirSync ( agentsDir , { recursive : true } )
692692
693693 writeAgentFile (
@@ -705,18 +705,14 @@ describe('Local Agent Integration', () => {
705705
706706 await initializeAgentRegistry ( )
707707
708- const logSpy = spyOn ( console , 'log' ) . mockImplementation ( ( ) => { } )
708+ // announceLoadedAgents uses logger.debug internally
709+ // We verify it runs without error and the data is available via getLoadedAgentsData
710+ announceLoadedAgents ( )
709711
710- try {
711- announceLoadedAgents ( )
712-
713- expect ( logSpy ) . toHaveBeenCalled ( )
714- const calls = logSpy . mock . calls . flat ( ) . join ( ' ' )
715- expect ( calls ) . toContain ( 'Loaded' )
716- expect ( calls ) . toContain ( 'Announce Test Agent' )
717- } finally {
718- logSpy . mockRestore ( )
719- }
712+ const data = getLoadedAgentsData ( )
713+ expect ( data ) . not . toBeNull ( )
714+ expect ( data ! . agents . some ( ( a ) => a . id === 'test-announce-agent' ) ) . toBe ( true )
715+ expect ( data ! . agents . some ( ( a ) => a . displayName === 'Announce Test Agent' ) ) . toBe ( true )
720716 } )
721717
722718 // ============================================================================
You can’t perform that action at this time.
0 commit comments