@@ -3,20 +3,20 @@ import { describe, expect, it } from 'vitest'
33import { bytesToHumanSize , getContentByteSize , toTree } from '../format'
44
55describe ( 'bytesToHumanSize' , ( ) => {
6- it ( 'should return raw bytes (<1024 )' , ( ) => {
6+ it ( 'should return raw bytes (<1000 )' , ( ) => {
77 expect ( bytesToHumanSize ( 10 ) ) . toEqual ( [ 10 , 'B' ] )
88 } )
99
1010 it ( 'should return kb with proper digits' , ( ) => {
11- expect ( bytesToHumanSize ( 1024 ) ) . toEqual ( [ '1' , 'KB ' ] )
12- expect ( bytesToHumanSize ( 1024 * 1.5 ) ) . toEqual ( [ '1.5' , 'KB ' ] )
13- expect ( bytesToHumanSize ( 1024 * 1.666 , 1 ) ) . toEqual ( [ '1.7' , 'KB ' ] )
11+ expect ( bytesToHumanSize ( 1000 ) ) . toEqual ( [ '1' , 'kB ' ] )
12+ expect ( bytesToHumanSize ( 1000 * 1.5 ) ) . toEqual ( [ '1.5' , 'kB ' ] )
13+ expect ( bytesToHumanSize ( 1000 * 1.666 , 1 ) ) . toEqual ( [ '1.7' , 'kB ' ] )
1414 } )
1515
1616 it ( 'should return mb with proper digits' , ( ) => {
17- expect ( bytesToHumanSize ( 1024 * 1024 ) ) . toEqual ( [ '1' , 'MB' ] )
18- expect ( bytesToHumanSize ( 1024 * 1024 * 1.5 ) ) . toEqual ( [ '1.5' , 'MB' ] )
19- expect ( bytesToHumanSize ( 1024 * 1024 * 1.666 , 1 ) ) . toEqual ( [ '1.7' , 'MB' ] )
17+ expect ( bytesToHumanSize ( 1000 * 1000 ) ) . toEqual ( [ '1' , 'MB' ] )
18+ expect ( bytesToHumanSize ( 1000 * 1000 * 1.5 ) ) . toEqual ( [ '1.5' , 'MB' ] )
19+ expect ( bytesToHumanSize ( 1000 * 1000 * 1.666 , 1 ) ) . toEqual ( [ '1.7' , 'MB' ] )
2020 } )
2121
2222 // larger...
0 commit comments