@@ -791,6 +791,69 @@ describe('Printer suite filtering', () => {
791791 } ) ;
792792} ) ;
793793
794+ describe ( 'Printer PRESET_PROGRESS dot colors' , ( ) => {
795+ const phpUnitXML = new PHPUnitXML ( ) . setRoot ( phpUnitProject ( '' ) ) ;
796+ const file = phpUnitProject ( 'tests/AssertionsTest.php' ) ;
797+ const printer = new Printer ( phpUnitXML , PRESET_PROGRESS ) ;
798+
799+ beforeEach ( ( ) => printer . start ( ) ) ;
800+ afterEach ( ( ) => printer . close ( ) ) ;
801+
802+ it ( 'failed dot F uses bgRed + white' , ( ) => {
803+ const output = printer . testFinished ( {
804+ event : TeamcityEvent . testFailed ,
805+ name : 'test_failed' ,
806+ locationHint : '' ,
807+ flowId : 1 ,
808+ id : 'Foo::test_failed' ,
809+ file,
810+ message : 'Failed asserting that false is true.' ,
811+ details : [ { file, line : 27 } ] ,
812+ duration : 0 ,
813+ } ) ;
814+
815+ expect ( output ) . toContain ( '\x1b[41m' ) ; // bgRed
816+ expect ( output ) . toContain ( '\x1b[37m' ) ; // white (fg)
817+ expect ( output ) . toContain ( 'F' ) ;
818+ } ) ;
819+
820+ it ( 'ignored dot S uses cyan + bold' , ( ) => {
821+ const output = printer . testIgnored ( {
822+ event : TeamcityEvent . testIgnored ,
823+ name : 'test_skipped' ,
824+ locationHint : '' ,
825+ flowId : 1 ,
826+ id : 'Foo::test_skipped' ,
827+ file,
828+ message : 'Skipped.' ,
829+ details : [ ] ,
830+ duration : 0 ,
831+ } ) ;
832+
833+ expect ( output ) . toContain ( '\x1b[36m' ) ; // cyan
834+ expect ( output ) . toContain ( '\x1b[1m' ) ; // bold
835+ expect ( output ) . toContain ( 'S' ) ;
836+ } ) ;
837+
838+ it ( 'error dot E uses red + bold (not bgRed)' , ( ) => {
839+ const output = printer . testFinished ( {
840+ event : TeamcityEvent . testFailed ,
841+ name : 'test_error' ,
842+ locationHint : '' ,
843+ flowId : 1 ,
844+ id : 'Foo::test_error' ,
845+ file,
846+ message : 'RuntimeException: something broke' ,
847+ details : [ { file, line : 10 } ] ,
848+ duration : 0 ,
849+ } ) ;
850+
851+ expect ( output ) . toContain ( '\x1b[31m' ) ; // red
852+ expect ( output ) . toContain ( '\x1b[1m' ) ; // bold
853+ expect ( output ) . toContain ( 'E' ) ;
854+ } ) ;
855+ } ) ;
856+
794857describe ( 'Printer inline error display' , ( ) => {
795858 const phpUnitXML = new PHPUnitXML ( ) . setRoot ( phpUnitProject ( '' ) ) ;
796859 const file = phpUnitProject ( 'tests/AssertionsTest.php' ) ;
0 commit comments