Open History to see the last commit
1import { describe, expect, it } from "vite-plus/test";
2
3import { LATENCY_PRESETS, formatLatency } from "./latency";
4
5describe("formatLatency", () => {
6 it("formats every preset", () => {
7 expect(LATENCY_PRESETS.map(formatLatency)).toEqual(["0 ms", "500 ms", "2 s", "5 s"]);
8 });
9
10 it("keeps fractional seconds", () => {
11 expect(formatLatency(1500)).toBe("1.5 s");
12 });
13});