@@ -2,6 +2,7 @@ import { afterEach, describe, expect, it, vi } from 'vitest';
22import type { PipelineEvent } from '../../types/pipeline-events.ts' ;
33import { renderEvents } from '../render.ts' ;
44import { createCliTextRenderer } from '../../utils/renderers/cli-text-renderer.ts' ;
5+ import { renderCliTextTranscript } from '../../utils/renderers/cli-text-renderer.ts' ;
56
67function captureCliText ( events : readonly PipelineEvent [ ] ) : string {
78 const stdoutWrite = vi . spyOn ( process . stdout , 'write' ) . mockImplementation ( ( ) => true ) ;
@@ -168,4 +169,37 @@ describe('text render parity', () => {
168169 expect ( output ) . toContain ( 'xcodebuildmcp macos get-app-path --scheme "MCPTest"' ) ;
169170 expect ( output ) . not . toContain ( 'get_mac_app_path({' ) ;
170171 } ) ;
172+
173+ it ( 'omits per-test results by default and includes them when showTestResults is true' , ( ) => {
174+ const events : PipelineEvent [ ] = [
175+ {
176+ type : 'test-case-result' ,
177+ timestamp : '2026-04-14T00:00:00.000Z' ,
178+ operation : 'TEST' ,
179+ suite : 'Suite' ,
180+ test : 'testA' ,
181+ status : 'passed' ,
182+ durationMs : 100 ,
183+ } ,
184+ {
185+ type : 'summary' ,
186+ timestamp : '2026-04-14T00:00:01.000Z' ,
187+ operation : 'TEST' ,
188+ status : 'SUCCEEDED' ,
189+ totalTests : 1 ,
190+ passedTests : 1 ,
191+ skippedTests : 0 ,
192+ durationMs : 100 ,
193+ } ,
194+ ] ;
195+
196+ const withoutFlag = renderCliTextTranscript ( events ) ;
197+ expect ( withoutFlag ) . not . toContain ( 'Test Results:' ) ;
198+ expect ( withoutFlag ) . toContain ( '1 test passed' ) ;
199+
200+ const withFlag = renderCliTextTranscript ( events , { showTestResults : true } ) ;
201+ expect ( withFlag ) . toContain ( 'Test Results:' ) ;
202+ expect ( withFlag ) . toContain ( 'Suite/testA (0.100s)' ) ;
203+ expect ( withFlag ) . toContain ( '1 test passed' ) ;
204+ } ) ;
171205} ) ;
0 commit comments