import { describe, expect, test } from 'vitest'; import { formatBytes } from './bytes'; describe('formatBytes', () => { test('picks the unit that keeps the figure above one', () => { expect(formatBytes(0)).toBe('0 B'); expect(formatBytes(999)).toBe('999 B'); expect(formatBytes(12_300)).toBe('12.3 KB'); expect(formatBytes(820_000_000_000)).toBe('820 GB'); expect(formatBytes(1_400_000_000_000)).toBe('1.4 TB'); }); });