Skip to content

Commit

Permalink
feat: TET-853 tests for files services
Browse files Browse the repository at this point in the history
  • Loading branch information
Michał Jamrożek committed May 13, 2024
1 parent 36d1078 commit 109ddbb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/services/files.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { formatFileSize, base64ToBlob } from './files';

Check warning on line 1 in src/services/files.test.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

'base64ToBlob' is defined but never used

describe('formatFileSize', () => {
it('formats file size from number of bytes provided', () => {
expect(formatFileSize(17)).toBe('17B');
expect(formatFileSize(1_567)).toBe('1.53KB');
expect(formatFileSize(1_725_500)).toBe('1.65MB');
expect(formatFileSize(1_512_476_123)).toBe('1.41GB');
expect(formatFileSize(2_276_892_423_978)).toBe('2.07TB');
});
});

0 comments on commit 109ddbb

Please sign in to comment.