@@ -88,7 +88,7 @@ describe('format-output utilities', () => {
8888 obj . self = obj
8989 const result = formatOutputForDisplay ( obj , { mode : 'raw' } )
9090 expect ( result ) . toContain ( '[Circular]' )
91- expect ( result ) . not . toThrow ( )
91+ expect ( ( ) => formatOutputForDisplay ( obj , { mode : 'raw' } ) ) . not . toThrow ( )
9292 } )
9393
9494 // Large arrays
@@ -126,16 +126,21 @@ describe('format-output utilities', () => {
126126
127127 // Mode-specific formatting
128128 it ( 'formats correctly for different modes' , ( ) => {
129- const obj = { data : 'test' }
129+ const obj = { someField : 'value' , type : 'test' }
130130
131131 const chatFormat = formatOutputForDisplay ( obj , { mode : 'chat' } )
132- expect ( chatFormat ) . toContain ( 'test' )
133-
134132 const workflowFormat = formatOutputForDisplay ( obj , { mode : 'workflow' } )
133+ const rawFormat = formatOutputForDisplay ( obj , { mode : 'raw' } )
134+
135+ // Chat mode should show JSON for objects without text fields
136+ expect ( chatFormat ) . toContain ( 'someField' )
137+
138+ // Workflow mode should wrap in code blocks
135139 expect ( workflowFormat ) . toMatch ( / ` ` ` j s o n / )
140+ expect ( workflowFormat ) . toContain ( 'someField' )
136141
137- const rawFormat = formatOutputForDisplay ( obj , { mode : 'raw' } )
138- expect ( rawFormat ) . toBe ( '{"data":"test"}' )
142+ // Raw mode should show plain JSON
143+ expect ( rawFormat ) . toMatch ( / " s o m e F i e l d " : \s * " v a l u e " / )
139144 } )
140145
141146 // Edge cases
0 commit comments