Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

AgentElapsed.test.ts

15 lines380 Bytes

1import { expect, it } from "vite-plus/test";
2​
3import { formatCompactElapsedSeconds } from "./AgentElapsed";
4​
5it.each([
6 [45, "45s"],
7 [90, "1m"],
8 [59 * 60 + 59, "59m"],
9 [60 * 60, "1h"],
10 [90 * 60, "1.5h"],
11 [119 * 60, "1.9h"],
12 [14 * 60 * 60 + 40 * 60, "14h"],
13])("formats %ss as %s", (seconds, label) => {
14 expect(formatCompactElapsedSeconds(seconds)).toBe(label);
15});