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

DiffStatLabel.test.ts

12 lines474 Bytes

1import { describe, expect, it } from "vite-plus/test";
2​
3import { formatCompactDiffCount } from "./DiffStatLabel";
4​
5describe("formatCompactDiffCount", () => {
6 it("promotes counts when rounding reaches the next suffix", () => {
7 expect(formatCompactDiffCount(999_499)).toBe("999k");
8 expect(formatCompactDiffCount(999_500)).toBe("1m");
9 expect(formatCompactDiffCount(999_499_999)).toBe("999m");
10 expect(formatCompactDiffCount(999_500_000)).toBe("1b");
11 });
12});