File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
test/unit/bin/helpers/sync Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -31,14 +31,15 @@ let getOptions = (auth, build_id) => {
31
31
}
32
32
33
33
let getTableConfig = ( ) => {
34
+ let terminalWidth = ( process . stdout . columns ) * 0.9 ;
34
35
return {
35
36
border : getBorderConfig ( ) ,
36
37
columns : {
37
38
1 : { alignment : 'center' , width : 1 } ,
38
- 2 : { alignment : 'left' , width : 100 }
39
+ 2 : { alignment : 'left' , width : Math . floor ( terminalWidth * 0.8 ) }
39
40
} ,
40
41
columnDefault : {
41
- width : 30 ,
42
+ width : Math . floor ( terminalWidth * 0.2 ) ,
42
43
} ,
43
44
columnCount : 3 ,
44
45
} ;
Original file line number Diff line number Diff line change @@ -92,11 +92,11 @@ describe("syncSpecsLogs", () => {
92
92
syncSpecsLogs . __set__ ( 'getBorderConfig' , getBorderConfigStub ) ;
93
93
94
94
let options = getTableConfig ( ) ;
95
- expect ( options . columnDefault . width ) . to . equal ( 30 ) ;
95
+ expect ( options . columnDefault . width ) . to . equal ( Math . floor ( ( ( process . stdout . columns ) * 0.9 ) * 0.2 ) ) ;
96
96
expect ( options . columns [ 1 ] . alignment ) . to . equal ( 'center' ) ;
97
97
expect ( options . columns [ 2 ] . alignment ) . to . equal ( 'left' ) ;
98
98
expect ( options . columns [ 1 ] . width ) . to . equal ( 1 ) ;
99
- expect ( options . columns [ 2 ] . width ) . to . equal ( 100 ) ;
99
+ expect ( options . columns [ 2 ] . width ) . to . equal ( Math . floor ( ( ( process . stdout . columns ) * 0.9 ) * 0.8 ) ) ;
100
100
expect ( options . columnCount ) . to . equal ( 3 ) ;
101
101
expect ( getBorderConfigStub . calledOnce ) . to . be . true ;
102
102
} ) ;
You can’t perform that action at this time.
0 commit comments