test: cov utils
This commit is contained in:
parent
696d91a5f9
commit
f18844b5be
1 changed files with 15 additions and 0 deletions
15
src/utils.test.ts
Normal file
15
src/utils.test.ts
Normal file
|
@ -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)
|
||||
},
|
||||
)
|
||||
})
|
Reference in a new issue