Skip to content

Commit

Permalink
test: fix coverage through silly means
Browse files Browse the repository at this point in the history
  • Loading branch information
EvAvKein committed May 24, 2024
1 parent a8f808d commit b799ed0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions frontend/src/helpers/secsToReadableDuration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,16 @@ describe("secsToReadableDuration", () => {
expectConversion(day * 6 + hour * 23 + minute * 59 + second * 59, "6d 23h 59m 59s");
});
});

it("Resolves coverage (on CI only)", () => {
// these do exactly the same as the above tests
// ...for whatever reason, CI decided to wake up one day and rule that the above was only 20% coverage. my machine remained at 100%.
// so here's this less-readable variant, generated by GitHub Copilot to satisfy the eldritch CI-only coverage gods
expect(secsToReadableDuration(0.9)).toBe("");
expect(secsToReadableDuration(1.1)).toBe("1s");
expect(secsToReadableDuration(60)).toBe("1m");
expect(secsToReadableDuration(3600)).toBe("1h");
expect(secsToReadableDuration(86400)).toBe("1d");
expect(secsToReadableDuration(3599)).toBe("59m 59s");
expect(secsToReadableDuration(64804)).toBe("18h 4s");
});

0 comments on commit b799ed0

Please sign in to comment.