Skip to content

Commit

Permalink
add a couple more unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mw-kapilg committed Aug 22, 2024
1 parent 8e77637 commit 8a3ce75
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/buildSummary.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,19 @@ describe('summaryGeneration', () => {
const mockBuildSummary = JSON.stringify([
{ name: 'Task 1', failed: true, skipped: false, description: 'Task 1 description', duration: '00:00:10' },
{ name: 'Task 2', failed: false, skipped: true, skipReason: 'UserSpecified', description: 'Task 2 description', duration: '00:00:20' },
{ name: 'Task 3', failed: false, skipped: false, description: 'Task 3 description', duration: '00:00:30' }
{ name: 'Task 3', failed: false, skipped: true, skipReason: 'DependencyFailed', description: 'Task 3 description', duration: '00:00:20' },
{ name: 'Task 4', failed: false, skipped: true, skipReason: 'UpToDate', description: 'Task 4 description', duration: '00:00:20' },
{ name: 'Task 5', failed: false, skipped: false, description: 'Task 5 description', duration: '00:00:30' }
]);

const result = buildSummary.getSummaryRows(mockBuildSummary);

expect(result).toEqual([
['Task 1', '🔴 Failed', 'Task 1 description', '00:00:10'],
['Task 2', '🔵 Skipped (user requested)', 'Task 2 description', '00:00:20'],
['Task 3', '🟢 Success', 'Task 3 description', '00:00:30']
['Task 3', '🔵 Skipped (dependency failed)', 'Task 3 description', '00:00:20'],
['Task 4', '🔵 Skipped (up-to-date)', 'Task 4 description', '00:00:20'],
['Task 5', '🟢 Success', 'Task 5 description', '00:00:30']
]);
});

Expand Down

0 comments on commit 8a3ce75

Please sign in to comment.