Files
91/tests/storageFormat.test.ts
T
2026-05-12 19:57:48 +08:00

13 lines
447 B
TypeScript

import assert from "node:assert/strict";
import test from "node:test";
import { formatBytes } from "../src/admin/storageFormat.ts";
test("formats byte counts for storage usage display", () => {
assert.equal(formatBytes(0), "0 B");
assert.equal(formatBytes(512), "512 B");
assert.equal(formatBytes(1536), "1.5 KB");
assert.equal(formatBytes(2 * 1024 * 1024), "2 MB");
assert.equal(formatBytes(3.25 * 1024 * 1024 * 1024), "3.3 GB");
});