From b8802d0efc0beda103a8fa6001c0e7d74313f41a Mon Sep 17 00:00:00 2001 From: Nikhil Bhoski <47204011+nbhoski@users.noreply.github.com> Date: Mon, 22 Jul 2024 11:39:38 +0530 Subject: [PATCH] Fixed #44 --- src/buildSummary.ts | 8 ++++---- src/buildSummary.unit.test.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/buildSummary.ts b/src/buildSummary.ts index 16e3350..ac05a87 100644 --- a/src/buildSummary.ts +++ b/src/buildSummary.ts @@ -13,7 +13,7 @@ export interface Task { export function getBuildSummaryTable(tasks: Task[]): string[][] { - const header: string[] = ['MATLAB Build Task', 'Status', 'Description', 'Duration (HH:MM:SS)']; + const header: string[] = ['MATLAB Build Task', 'Status', 'Description', 'Duration (hh:mm:ss)']; let taskSummaryTableRows: string[][] = [header]; if(!Array.isArray(tasks)){ @@ -68,11 +68,11 @@ export function getTaskDetails(tasks: Task): string[] { let taskDetails: string[] = []; taskDetails.push(tasks.name); if (tasks.failed) { - taskDetails.push('🔴 FAILED'); + taskDetails.push('🔴 Failed'); } else if (tasks.skipped) { - taskDetails.push('🔵 SKIPPED'); + taskDetails.push('🔵 Skipped'); } else { - taskDetails.push('🟢 SUCCESS'); + taskDetails.push('🟢 Success'); } taskDetails.push(tasks.description); taskDetails.push(tasks.duration); diff --git a/src/buildSummary.unit.test.ts b/src/buildSummary.unit.test.ts index 0586f9f..f98ce60 100644 --- a/src/buildSummary.unit.test.ts +++ b/src/buildSummary.unit.test.ts @@ -19,7 +19,7 @@ describe('summaryGeneration', () => { const expectedTable = [ ['MATLAB Build Task', 'Status', 'Description', 'Duration (HH:MM:SS)'], - ['Test Task', '🔴 FAILED', 'A test task', '00:00:10'], + ['Test Task', '🔴 Failed', 'A test task', '00:00:10'], ]; const table = buildSummary.getBuildSummaryTable(mockTasks); @@ -30,7 +30,7 @@ describe('summaryGeneration', () => { it('writes the summary correctly', () => { const mockTableRows = [ ['MATLAB Build Task', 'Status', 'Description', 'Duration (HH:MM:SS)'], - ['Test Task', '🔴 FAILED', 'A test task', '00:00:10'], + ['Test Task', '🔴 Failed', 'A test task', '00:00:10'], ]; buildSummary.writeSummary(mockTableRows);