File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 55// ```
66const fs = require ( "fs" ) ;
77const path = require ( "path" ) ;
8+ const os = require ( 'os' ) ;
89const { Options, runTest} = require ( 'browser-ui-test' ) ;
910
1011function showHelp ( ) {
@@ -78,19 +79,23 @@ function char_printer(n_tests) {
7879 successful : function ( ) {
7980 current += 1 ;
8081 if ( current % max_per_line === 0 ) {
81- process . stdout . write ( `. (${ current } /${ n_tests } )\n ` ) ;
82+ process . stdout . write ( `. (${ current } /${ n_tests } )${ os . EOL } ` ) ;
8283 } else {
8384 process . stdout . write ( "." ) ;
8485 }
8586 } ,
8687 erroneous : function ( ) {
8788 current += 1 ;
8889 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 } ` ) ;
9091 } else {
9192 process . stderr . write ( "F" ) ;
9293 }
9394 } ,
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+ } ,
9499 } ;
95100}
96101
@@ -187,9 +192,10 @@ async function main(argv) {
187192 await tests [ i ] ;
188193 }
189194 }
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 ( ) ;
193199
194200 if ( debug === false ) {
195201 results . successful . sort ( by_filename ) ;
You can’t perform that action at this time.
0 commit comments