Skip to content

Commit

Permalink
test: attempt to resolve CI-only coverage gap
Browse files Browse the repository at this point in the history
running the test locally said it was 100%, but in CI it said only 20%, so this commit is GH-Copilot's attempt at brute-forcing it...
  • Loading branch information
EvAvKein committed May 24, 2024
1 parent 8a75930 commit a83a52c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions frontend/src/helpers/secsToReadableDuration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,21 @@ function expectConversion(secs: number, expected: string) {
expect(secsToReadableDuration(secs)).toBe(expected);
}

describe("testDebug", () => {
it("attempts (by GH-Copliot) to brute-force coverage, after i told it local Istanbul reports 100% but CI only 20%", () => {
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");
expect(secsToReadableDuration(172740)).toBe("2d 34m");
expect(secsToReadableDuration(280053)).toBe("3d 17m 33s");
expect(secsToReadableDuration(622799)).toBe("6d 23h 59m 59s");
});
});

describe("secsToReadableDuration", () => {
it("Round decimals down", () => {
expectConversion(0.9, "");
Expand Down

0 comments on commit a83a52c

Please sign in to comment.