Skip to content
Source
Sign inSign up
fuko/trytanstackdb-v2
Open History to see the last commit

latency.test.ts

13 lines383 Bytes

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});