@@ -23,6 +23,11 @@ function* formatTestSuite(suite) {
2323 }
2424 yield '</ul>\n' ;
2525}
26+ function formatRow ( ...items ) {
27+ const tds = items . map ( ( item ) => `<td>${ item } </td>` ) ;
28+ return `<tr>${ tds . join ( '' ) } </tr>
29+ ` ;
30+ }
2631function getTestCount ( item ) {
2732 if ( item . type === 'test' ) return 1 ;
2833 let output = 0 ;
@@ -44,15 +49,10 @@ var GithubActionsSummaryReporter = class {
4449 if ( ! this . writeStream ) return ;
4550 this . writeStream . write ( '## Test Results\n' ) ;
4651 for ( const testModule of modules ) {
47- const formatRow2 = function ( ...items ) {
48- const tds = items . map ( ( item ) => `<td>${ item } </td>` ) ;
49- return `<tr>${ tds . join ( '' ) } </tr>
50- ` ;
51- } ;
52- var formatRow = formatRow2 ;
5352 const passed = testModule . ok ( ) ;
53+ const fileName = testModule . location ?? 'undefined`' ;
5454 const testCount = getTestCount ( testModule ) ;
55- this . writeStream . write ( `${ passed ? '\u2705' : '\u274C' } ( fileName) (${ testCount } test${ testCount === 1 ? '' : 's' } )
55+ this . writeStream . write ( `${ passed ? '\u2705' : '\u274C' } \` ${ fileName } \` (${ testCount } test${ testCount === 1 ? '' : 's' } )
5656` ) ;
5757 this . writeStream . write ( '<ul>' ) ;
5858 for ( const child of testModule . children ) {
@@ -64,12 +64,13 @@ var GithubActionsSummaryReporter = class {
6464 const diagnostics = testModule . diagnostic ( ) ;
6565 const totalDuration = diagnostics . duration . toFixed ( 0 ) ;
6666 this . writeStream . write ( '\n\n' ) ;
67- this . writeStream . write ( '#### Summary\n' ) ;
68- this . writeStream . write ( '<table>' ) ;
69- this . writeStream . write ( formatRow2 ( 'Test Files' , '' ) ) ;
70- this . writeStream . write ( formatRow2 ( 'Tests' , testCount . toString ( ) ) ) ;
71- this . writeStream . write ( formatRow2 ( 'Start at' , '' ) ) ;
72- this . writeStream . write ( formatRow2 ( 'Duration' , `${ totalDuration } ms` ) ) ;
67+ this . writeStream . write ( `#### Summary for \`${ fileName } \`
68+ ` ) ;
69+ this . writeStream . write ( '<table>\n' ) ;
70+ this . writeStream . write ( formatRow ( 'Test Files' , '' ) ) ;
71+ this . writeStream . write ( formatRow ( 'Tests' , testCount . toString ( ) ) ) ;
72+ this . writeStream . write ( formatRow ( 'Start at' , '' ) ) ;
73+ this . writeStream . write ( formatRow ( 'Duration' , `${ totalDuration } ms` ) ) ;
7374 this . writeStream . write ( '</table>' ) ;
7475 }
7576 this . writeStream . close ( ) ;
0 commit comments