@@ -50,14 +50,14 @@ interface TestResultsData {
5050export function writeSummary ( testResults : MatlabTestFile [ ] [ ] , stats : TestStatistics ) {
5151 try {
5252 const header = getTestHeader ( testResults , stats ) ;
53- const detailedResults = getDetailedResults ( testResults ) ;
5453 const failedTests = getFailedTests ( testResults ) ;
54+ const detailedResults = getDetailedResults ( testResults ) ;
5555
5656 core . summary
5757 . addHeading ( 'MATLAB Test Results' )
5858 . addRaw ( header , true )
59- . addRaw ( detailedResults , true )
6059 . addRaw ( failedTests , true )
60+ . addRaw ( detailedResults , true )
6161 . write ( ) ;
6262 } catch ( e ) {
6363 console . error ( 'An error occurred while adding the test results to the summary:' , e ) ;
@@ -121,16 +121,28 @@ function getFailedTests(testResults: MatlabTestFile[][]): string {
121121
122122 if ( failedTests . length === 0 ) return '' ;
123123
124- return `<details><summary><h3>Failed tests</h3></summary>
125- ${ failedTests . map ( test => generateFailedTestDetails ( test ) ) . join ( '\n' ) }
124+ return `<details open><summary><h3>Failed tests</h3></summary>
125+ <table>
126+ <tr>
127+ <th>Test</th>
128+ <th>Details</th>
129+ </tr>
130+ ${ failedTests . map ( test => generateFailedTestRow ( test ) ) . join ( '\n' ) }
131+ </table>
126132 </details>` ;
127133}
128134
129- function generateFailedTestDetails ( test : MatlabTestCase ) : string {
130- return `<h4><b>❌ <u>${ test . name } failed</u></b></h4>
131- <details><summary>View stack trace</summary></br>
132- <pre>${ test . diagnostics . map ( d => d . report ) . join ( '\n' ) } </pre>
133- </details>` ;
135+ function generateFailedTestRow ( test : MatlabTestCase ) : string {
136+ return `
137+ <tr>
138+ <td><b>❌ ${ test . name } </b></td>
139+ <td>
140+ <details>
141+ <summary>View details</summary>
142+ <pre>${ test . diagnostics . map ( d => d . report ) . join ( '\n' ) } </pre>
143+ </details>
144+ </td>
145+ </tr>` ;
134146}
135147
136148function getStatusEmoji ( status : MatlabTestStatus ) : string {
0 commit comments