File tree 1 file changed +11
-5
lines changed
1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 5
5
// ```
6
6
const fs = require ( "fs" ) ;
7
7
const path = require ( "path" ) ;
8
+ const os = require ( 'os' ) ;
8
9
const { Options, runTest} = require ( 'browser-ui-test' ) ;
9
10
10
11
function showHelp ( ) {
@@ -78,19 +79,23 @@ function char_printer(n_tests) {
78
79
successful : function ( ) {
79
80
current += 1 ;
80
81
if ( current % max_per_line === 0 ) {
81
- process . stdout . write ( `. (${ current } /${ n_tests } )\n ` ) ;
82
+ process . stdout . write ( `. (${ current } /${ n_tests } )${ os . EOL } ` ) ;
82
83
} else {
83
84
process . stdout . write ( "." ) ;
84
85
}
85
86
} ,
86
87
erroneous : function ( ) {
87
88
current += 1 ;
88
89
if ( current % max_per_line === 0 ) {
89
- process . stderr . write ( `F (${ current } /${ n_tests } )\n ` ) ;
90
+ process . stderr . write ( `F (${ current } /${ n_tests } )${ os . EOL } ` ) ;
90
91
} else {
91
92
process . stderr . write ( "F" ) ;
92
93
}
93
94
} ,
95
+ finish : function ( ) {
96
+ const spaces = " " . repeat ( max_per_line - ( current % max_per_line ) ) ;
97
+ process . stdout . write ( `${ spaces } (${ current } /${ n_tests } )${ os . EOL } ${ os . EOL } ` ) ;
98
+ } ,
94
99
} ;
95
100
}
96
101
@@ -187,9 +192,10 @@ async function main(argv) {
187
192
await tests [ i ] ;
188
193
}
189
194
}
190
- await Promise . all ( tests ) ;
191
- // final \n after the tests
192
- console . log ( "\n" ) ;
195
+ if ( ! no_headless ) {
196
+ await Promise . all ( tests ) ;
197
+ }
198
+ status_bar . finish ( ) ;
193
199
194
200
if ( debug === false ) {
195
201
results . successful . sort ( by_filename ) ;
You can’t perform that action at this time.
0 commit comments