@@ -66,7 +66,7 @@ describe('coverage-evaluator', () => {
6666
6767 it ( 'should count as one failure when coverage report is missing' , ( ) => {
6868 const mockGetProjectThresholds = getProjectThresholds as jest . Mock ;
69- mockGetProjectThresholds . mockReturnValue ( { lines : 80 } ) ;
69+ mockGetProjectThresholds . mockReturnValue ( { lines : 80 , statements : 75 } ) ;
7070
7171 const mockExistsSync = fs . existsSync as jest . Mock ;
7272 mockExistsSync . mockReturnValue ( false ) ;
@@ -76,11 +76,11 @@ describe('coverage-evaluator', () => {
7676 expect ( result ) . toBe ( 1 ) ;
7777 expect ( core . warning ) . toHaveBeenCalledWith ( 'No coverage report found for project-a at coverage/project-a/coverage-summary.json' ) ;
7878
79- // Verify that the comment indicates the project failed due to missing report
79+ // Verify that the comment shows individual thresholds with "No Data"
8080 const writeFileSyncMock = fs . writeFileSync as jest . Mock ;
8181 const comment = writeFileSyncMock . mock . calls [ 0 ] [ 1 ] ;
82- expect ( comment ) . toContain ( '❌ FAILED' ) ;
83- expect ( comment ) . toContain ( 'No Data' ) ;
82+ expect ( comment ) . toContain ( '| project-a | lines | 80% | No Data | ❌ FAILED | ' ) ;
83+ expect ( comment ) . toContain ( '| | statements | 75% | No Data | ❌ FAILED | ' ) ;
8484 expect ( comment ) . toContain ( '⚠️ WARNING (1 project failing)' ) ;
8585 } ) ;
8686
@@ -181,11 +181,13 @@ describe('coverage-evaluator', () => {
181181 expect ( result ) . toBe ( 1 ) ;
182182 expect ( core . error ) . toHaveBeenCalledWith ( 'Error processing coverage for project-a: Test error' ) ;
183183
184- // Verify that the comment shows an error status
184+ // Verify that the comment shows individual thresholds with "No Data"
185185 const writeFileSyncMock = fs . writeFileSync as jest . Mock ;
186186 const comment = writeFileSyncMock . mock . calls [ 0 ] [ 1 ] ;
187- expect ( comment ) . toContain ( '❌ FAILED' ) ;
188- expect ( comment ) . toContain ( 'No Data' ) ;
187+ expect ( comment ) . toContain ( '| project-a | lines | 80% | No Data | ❌ FAILED |' ) ;
188+ expect ( comment ) . toContain ( '| | statements | 80% | No Data | ❌ FAILED |' ) ;
189+ expect ( comment ) . toContain ( '| | functions | 75% | No Data | ❌ FAILED |' ) ;
190+ expect ( comment ) . toContain ( '| | branches | 70% | No Data | ❌ FAILED |' ) ;
189191 expect ( comment ) . toContain ( '### Overall Status: ⚠️ WARNING (1 project failing)' ) ;
190192 } ) ;
191193
@@ -328,7 +330,10 @@ describe('coverage-evaluator', () => {
328330 expect ( comment ) . toContain ( '| project-c | lines | 70% | 65.00% | ❌ FAILED |' ) ;
329331
330332 // Project D has no coverage data
331- expect ( comment ) . toContain ( '| project-d | All | Defined | No Data | ❌ FAILED |' ) ;
333+ expect ( comment ) . toContain ( '| project-d | lines | 90% | No Data | ❌ FAILED |' ) ;
334+ expect ( comment ) . toContain ( '| | statements | 90% | No Data | ❌ FAILED |' ) ;
335+ expect ( comment ) . toContain ( '| | functions | 90% | No Data | ❌ FAILED |' ) ;
336+ expect ( comment ) . toContain ( '| | branches | 90% | No Data | ❌ FAILED |' ) ;
332337
333338 // Overall status is failed with multiple projects
334339 expect ( comment ) . toContain ( '### Overall Status: ❌ FAILED (2 projects failing)' ) ;
0 commit comments