This repository has been archived on 2024-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
packwatch/tests/utils.test.ts
Marc Cataford 2ec9c0e533
build: transition to Typescript without Babel (#252)
* build: ts-jest

* build: yarn latest

* build: no babel

* chore: lint

* refactor: test, types
2021-06-05 11:29:15 -04:00

15 lines
428 B
TypeScript

import { convertSizeToBytes } from '../src/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)
},
)
})