import { describe, expect, it } from "bun:test";
import { formatUptime } from "./format";

describe("formatUptime", () => {
    it("formats seconds correctly", () => {
        expect(formatUptime(45)).toBe("45s");
    });

    it("formats minutes and seconds", () => {
        expect(formatUptime(65)).toBe("1m 5s");
    });

    it("formats hours, minutes, and seconds", () => {
        expect(formatUptime(3665)).toBe("1h 1m 5s");
    });

    it("formats days correctly", () => {
        expect(formatUptime(90061)).toBe("1d 1h 1m 1s");
    });

    it("handles zero", () => {
        expect(formatUptime(0)).toBe("0s");
    });
});
