From b88efb6745cb783eeeb85711eb585a6dcad8ec88 Mon Sep 17 00:00:00 2001 From: Nikhil Bhoski <47204011+nbhoski@users.noreply.github.com> Date: Fri, 21 Jun 2024 14:06:10 +0530 Subject: [PATCH] Changed the tabe heading --- src/buildSummary.ts | 5 ++--- src/buildSummary.unit.test.ts | 7 ++----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/buildSummary.ts b/src/buildSummary.ts index 7ddbc2f..2a5c050 100644 --- a/src/buildSummary.ts +++ b/src/buildSummary.ts @@ -30,7 +30,7 @@ export async function readJsonFile(filePath: string): Promise { } export function getBuildSummaryTable(tasks: TaskList): string[][] { - const header: string[] = ['Task Name', 'Status', 'Description', 'Duration (HH:MM:SS)']; + const header: string[] = ['MATLAB Build Task', 'Status', 'Description', 'Duration (HH:MM:SS)']; let taskSummaryTableRows: string[][] = [header]; tasks.taskDetails.forEach((task, index) => { @@ -41,7 +41,7 @@ export function getBuildSummaryTable(tasks: TaskList): string[][] { } else if (task.skipped) { taskDetails.push('🔵 SKIPPED'); } else { - taskDetails.push('🟢 PASSED'); + taskDetails.push('🟢 SUCCESS'); } taskDetails.push(task.description); taskDetails.push(task.duration); @@ -54,7 +54,6 @@ export function getBuildSummaryTable(tasks: TaskList): string[][] { export function writeSummary(taskSummaryTableRows: string[][]) { core.summary - .addHeading('MATLAB Build Results') .addTable(taskSummaryTableRows) .write(); } diff --git a/src/buildSummary.unit.test.ts b/src/buildSummary.unit.test.ts index 88250b2..d686c98 100644 --- a/src/buildSummary.unit.test.ts +++ b/src/buildSummary.unit.test.ts @@ -21,7 +21,7 @@ describe('summaryGeneration', () => { }; const expectedTable = [ - ['Task Name', 'Status', 'Description', 'Duration (HH:MM:SS)'], + ['MATLAB Build Task', 'Status', 'Description', 'Duration (HH:MM:SS)'], ['Test Task', '🔴 FAILED', 'A test task', '00:00:10'], ]; @@ -32,15 +32,12 @@ describe('summaryGeneration', () => { it('writes the summary correctly', () => { const mockTableRows = [ - ['Task Name', 'Status', 'Description', 'Duration (HH:MM:SS)'], + ['MATLAB Build Task', 'Status', 'Description', 'Duration (HH:MM:SS)'], ['Test Task', '🔴 FAILED', 'A test task', '00:00:10'], ]; buildSummary.writeSummary(mockTableRows); - expect(core.summary.addHeading).toHaveBeenCalledTimes(1); - expect(core.summary.addHeading).toHaveBeenCalledWith('MATLAB Build Results'); - expect(core.summary.addTable).toHaveBeenCalledTimes(1); expect(core.summary.addTable).toHaveBeenCalledWith(mockTableRows); });