mirror of
https://github.com/outline/outline.git
synced 2026-01-04 10:09:52 -06:00
15 lines
598 B
TypeScript
15 lines
598 B
TypeScript
import { bytesToHumanReadable } from "./files";
|
|
|
|
describe("bytesToHumanReadable", () => {
|
|
test("Outputs readable string", () => {
|
|
expect(bytesToHumanReadable(0)).toBe("0 Bytes");
|
|
expect(bytesToHumanReadable(500)).toBe("500 Bytes");
|
|
expect(bytesToHumanReadable(1000)).toBe("1 kB");
|
|
expect(bytesToHumanReadable(15000)).toBe("15 kB");
|
|
expect(bytesToHumanReadable(12345)).toBe("12.34 kB");
|
|
expect(bytesToHumanReadable(123456)).toBe("123.45 kB");
|
|
expect(bytesToHumanReadable(1234567)).toBe("1.23 MB");
|
|
expect(bytesToHumanReadable(undefined)).toBe("0 Bytes");
|
|
});
|
|
});
|