@@ -2,32 +2,36 @@ import * as React from 'react';
22import { Box , Color , ColorProps } from 'ink' ;
33import { TestResult } from '@jest/test-result' ;
44import { Config } from '@jest/types' ;
5+ import chalk from 'chalk' ;
56import slash from 'slash' ;
67import { relativePath } from './utils' ;
78
89export const Arrow : React . FC = ( ) => < > { ' \u203A ' } </ > ;
910export const Dot : React . FC = ( ) => < > { ' \u2022 ' } </ > ;
1011export const DownArrow : React . FC = ( ) => < > { ' \u21B3 ' } </ > ;
1112
13+ const pad = ( string : string ) => ( chalk . supportsColor ? ` ${ string } ` : string ) ;
14+
1215const PaddedColor : React . FC < ColorProps > = ( { children, ...props } ) => (
1316 < Box paddingRight = { 1 } >
14- < Color { ...props } >
15-
16- { children }
17-
18- </ Color >
17+ < Color { ...props } > { children } </ Color >
1918 </ Box >
2019) ;
2120
22- const Status : React . FC < ColorProps > = props => (
23- < PaddedColor inverse bold { ...props } />
21+ const Status : React . FC < ColorProps & { text : string } > = ( {
22+ text,
23+ ...props
24+ } ) => (
25+ < PaddedColor inverse bold { ...props } >
26+ { pad ( text ) }
27+ </ PaddedColor >
2428) ;
2529
26- const Fails : React . FC = ( ) => < Status red > FAIL</ Status > ;
30+ const Fails : React . FC = ( ) => < Status red text = " FAIL" / >;
2731
28- const Pass : React . FC = ( ) => < Status green > PASS</ Status > ;
32+ const Pass : React . FC = ( ) => < Status green text = " PASS" / >;
2933
30- export const Runs : React . FC = ( ) => < Status yellow > RUNS</ Status > ;
34+ export const Runs : React . FC = ( ) => < Status yellow text = " RUNS" / >;
3135
3236export const DisplayName : React . FC < {
3337 config : Config . ProjectConfig ;
0 commit comments