@@ -19,16 +19,16 @@ describe('formatSpeed', () => {
1919 expect ( formatSpeed ( 1023 ) ) . toBe ( '1023 B/s' )
2020 } )
2121
22- it ( 'formats kilobytes per second' , ( ) => {
23- expect ( formatSpeed ( 1024 ) ) . toBe ( '1.0 KB /s' )
24- expect ( formatSpeed ( 1536 ) ) . toBe ( '1.5 KB /s' )
25- expect ( formatSpeed ( 1024 * 1024 - 1 ) ) . toBe ( '1024.0 KB /s' )
22+ it ( 'formats kibibytes per second' , ( ) => {
23+ expect ( formatSpeed ( 1024 ) ) . toBe ( '1.0 KiB /s' )
24+ expect ( formatSpeed ( 1536 ) ) . toBe ( '1.5 KiB /s' )
25+ expect ( formatSpeed ( 1024 * 1024 - 1 ) ) . toBe ( '1024.0 KiB /s' )
2626 } )
2727
28- it ( 'formats megabytes per second' , ( ) => {
29- expect ( formatSpeed ( 1024 * 1024 ) ) . toBe ( '1.00 MB /s' )
30- expect ( formatSpeed ( 1.5 * 1024 * 1024 ) ) . toBe ( '1.50 MB /s' )
31- expect ( formatSpeed ( 100 * 1024 * 1024 ) ) . toBe ( '100.00 MB /s' )
28+ it ( 'formats mebibytes per second' , ( ) => {
29+ expect ( formatSpeed ( 1024 * 1024 ) ) . toBe ( '1.00 MiB /s' )
30+ expect ( formatSpeed ( 1.5 * 1024 * 1024 ) ) . toBe ( '1.50 MiB /s' )
31+ expect ( formatSpeed ( 100 * 1024 * 1024 ) ) . toBe ( '100.00 MiB /s' )
3232 } )
3333
3434 it ( 'returns dash when showZero is false and value is 0' , ( ) => {
@@ -43,24 +43,24 @@ describe('formatSize', () => {
4343 expect ( formatSize ( 1023 ) ) . toBe ( '1023 B' )
4444 } )
4545
46- it ( 'formats kilobytes ' , ( ) => {
47- expect ( formatSize ( 1024 ) ) . toBe ( '1.0 KB ' )
48- expect ( formatSize ( 1536 ) ) . toBe ( '1.5 KB ' )
46+ it ( 'formats kibibytes ' , ( ) => {
47+ expect ( formatSize ( 1024 ) ) . toBe ( '1.0 KiB ' )
48+ expect ( formatSize ( 1536 ) ) . toBe ( '1.5 KiB ' )
4949 } )
5050
51- it ( 'formats megabytes ' , ( ) => {
52- expect ( formatSize ( 1024 * 1024 ) ) . toBe ( '1.0 MB ' )
53- expect ( formatSize ( 500 * 1024 * 1024 ) ) . toBe ( '500.0 MB ' )
51+ it ( 'formats mebibytes ' , ( ) => {
52+ expect ( formatSize ( 1024 * 1024 ) ) . toBe ( '1.0 MiB ' )
53+ expect ( formatSize ( 500 * 1024 * 1024 ) ) . toBe ( '500.0 MiB ' )
5454 } )
5555
56- it ( 'formats gigabytes ' , ( ) => {
57- expect ( formatSize ( 1024 * 1024 * 1024 ) ) . toBe ( '1.00 GB ' )
58- expect ( formatSize ( 4.7 * 1024 * 1024 * 1024 ) ) . toBe ( '4.70 GB ' )
56+ it ( 'formats gibibytes ' , ( ) => {
57+ expect ( formatSize ( 1024 * 1024 * 1024 ) ) . toBe ( '1.00 GiB ' )
58+ expect ( formatSize ( 4.7 * 1024 * 1024 * 1024 ) ) . toBe ( '4.70 GiB ' )
5959 } )
6060
61- it ( 'formats terabytes ' , ( ) => {
62- expect ( formatSize ( 1024 * 1024 * 1024 * 1024 ) ) . toBe ( '1.00 TB ' )
63- expect ( formatSize ( 2.5 * 1024 * 1024 * 1024 * 1024 ) ) . toBe ( '2.50 TB ' )
61+ it ( 'formats tebibytes ' , ( ) => {
62+ expect ( formatSize ( 1024 * 1024 * 1024 * 1024 ) ) . toBe ( '1.00 TiB ' )
63+ expect ( formatSize ( 2.5 * 1024 * 1024 * 1024 * 1024 ) ) . toBe ( '2.50 TiB ' )
6464 } )
6565} )
6666
@@ -73,14 +73,14 @@ describe('formatCompactSpeed', () => {
7373 expect ( formatCompactSpeed ( 512 ) ) . toBe ( '512B' )
7474 } )
7575
76- it ( 'formats compact kilobytes ' , ( ) => {
77- expect ( formatCompactSpeed ( 1024 ) ) . toBe ( '1K ' )
78- expect ( formatCompactSpeed ( 2048 ) ) . toBe ( '2K ' )
76+ it ( 'formats compact kibibytes ' , ( ) => {
77+ expect ( formatCompactSpeed ( 1024 ) ) . toBe ( '1Ki ' )
78+ expect ( formatCompactSpeed ( 2048 ) ) . toBe ( '2Ki ' )
7979 } )
8080
81- it ( 'formats compact megabytes ' , ( ) => {
82- expect ( formatCompactSpeed ( 1024 * 1024 ) ) . toBe ( '1.0M ' )
83- expect ( formatCompactSpeed ( 10.5 * 1024 * 1024 ) ) . toBe ( '10.5M ' )
81+ it ( 'formats compact mebibytes ' , ( ) => {
82+ expect ( formatCompactSpeed ( 1024 * 1024 ) ) . toBe ( '1.0Mi ' )
83+ expect ( formatCompactSpeed ( 10.5 * 1024 * 1024 ) ) . toBe ( '10.5Mi ' )
8484 } )
8585} )
8686
@@ -89,16 +89,16 @@ describe('formatCompactSize', () => {
8989 expect ( formatCompactSize ( 512 ) ) . toBe ( '512B' )
9090 } )
9191
92- it ( 'formats compact kilobytes ' , ( ) => {
93- expect ( formatCompactSize ( 1024 ) ) . toBe ( '1K ' )
92+ it ( 'formats compact kibibytes ' , ( ) => {
93+ expect ( formatCompactSize ( 1024 ) ) . toBe ( '1Ki ' )
9494 } )
9595
96- it ( 'formats compact megabytes ' , ( ) => {
97- expect ( formatCompactSize ( 1024 * 1024 ) ) . toBe ( '1M ' )
96+ it ( 'formats compact mebibytes ' , ( ) => {
97+ expect ( formatCompactSize ( 1024 * 1024 ) ) . toBe ( '1Mi ' )
9898 } )
9999
100- it ( 'formats compact gigabytes ' , ( ) => {
101- expect ( formatCompactSize ( 1024 * 1024 * 1024 ) ) . toBe ( '1.0G ' )
100+ it ( 'formats compact gibibytes ' , ( ) => {
101+ expect ( formatCompactSize ( 1024 * 1024 * 1024 ) ) . toBe ( '1.0Gi ' )
102102 } )
103103} )
104104
@@ -300,25 +300,25 @@ describe('normalizeSearch', () => {
300300describe ( 'format edge cases' , ( ) => {
301301 describe ( 'formatSpeed edge cases' , ( ) => {
302302 it ( 'handles very large values' , ( ) => {
303- expect ( formatSpeed ( 1024 * 1024 * 1024 ) ) . toBe ( '1024.00 MB /s' )
303+ expect ( formatSpeed ( 1024 * 1024 * 1024 ) ) . toBe ( '1024.00 MiB /s' )
304304 } )
305305
306306 it ( 'handles floating point precision' , ( ) => {
307- expect ( formatSpeed ( 1536 ) ) . toBe ( '1.5 KB /s' )
307+ expect ( formatSpeed ( 1536 ) ) . toBe ( '1.5 KiB /s' )
308308 } )
309309 } )
310310
311311 describe ( 'formatSize edge cases' , ( ) => {
312312 it ( 'handles exact boundary values' , ( ) => {
313- expect ( formatSize ( 1024 ) ) . toBe ( '1.0 KB ' )
314- expect ( formatSize ( 1024 * 1024 ) ) . toBe ( '1.0 MB ' )
315- expect ( formatSize ( 1024 * 1024 * 1024 ) ) . toBe ( '1.00 GB ' )
316- expect ( formatSize ( 1024 * 1024 * 1024 * 1024 ) ) . toBe ( '1.00 TB ' )
313+ expect ( formatSize ( 1024 ) ) . toBe ( '1.0 KiB ' )
314+ expect ( formatSize ( 1024 * 1024 ) ) . toBe ( '1.0 MiB ' )
315+ expect ( formatSize ( 1024 * 1024 * 1024 ) ) . toBe ( '1.00 GiB ' )
316+ expect ( formatSize ( 1024 * 1024 * 1024 * 1024 ) ) . toBe ( '1.00 TiB ' )
317317 } )
318318
319319 it ( 'handles values just below boundaries' , ( ) => {
320320 expect ( formatSize ( 1023 ) ) . toBe ( '1023 B' )
321- expect ( formatSize ( 1024 * 1024 - 1 ) ) . toBe ( '1024.0 KB ' )
321+ expect ( formatSize ( 1024 * 1024 - 1 ) ) . toBe ( '1024.0 KiB ' )
322322 } )
323323 } )
324324
0 commit comments