diff --git a/src/utils.test.ts b/src/utils.test.ts new file mode 100644 index 0000000..5a4ea33 --- /dev/null +++ b/src/utils.test.ts @@ -0,0 +1,15 @@ +import { convertSizeToBytes } from './utils' + +describe('utils', () => { + it.each` + initialSize | expectedSize + ${'1 B'} | ${1} + ${'1 kB'} | ${1000} + ${'1 mB'} | ${1000000} + `( + 'converts sizes properly ($initialSize -> $expectedSize)', + ({ initialSize, expectedSize }) => { + expect(convertSizeToBytes(initialSize)).toEqual(expectedSize) + }, + ) +})