Skip to content

Commit

Permalink
fix: duration in seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
Ma11hewThomas committed Oct 18, 2024
1 parent bbfd423 commit bdb612b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/message-formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ export const formatResultsMessage = (ctrf: CtrfReport): object => {
? `${failedTests} failed tests`
: `Passed`;

const duration = summary.stop - summary.start;
const durationText = `Duration: ${new Date(duration * 1000).toISOString().substr(11, 8)}`;
const durationInSeconds = (summary.stop - summary.start) / 1000;
const durationText = durationInSeconds < 1
? "*Duration:* <1s"
: `*Duration:* ${new Date(durationInSeconds * 1000).toISOString().substr(11, 8)}`;

const testSummary = `&#x2705; ${passedTests} | &#x274C; ${failedTests} | &#x23E9; ${skippedTests} | &#x23F3; ${pendingTests} | &#x2753; ${otherTests}`;

Expand Down

0 comments on commit bdb612b

Please sign in to comment.