From f18844b5be0c8b9c2d38959630b779d930a9f47e Mon Sep 17 00:00:00 2001 From: Marc Cataford Date: Thu, 18 Feb 2021 23:28:19 -0500 Subject: [PATCH] test: cov utils --- src/utils.test.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/utils.test.ts 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) + }, + ) +})