-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(@angular/build): format sizes using decimal byte units consistently
Ensure that file sizes are consistently formatted using decimal byte units, adhering to the International System of Units (SI) convention. This aligns with clarity and standardization across the project. - Kilobyte (kB): 10^3 bytes (1000 bytes) - Megabyte (MB): 10^6 bytes (1,000,000 bytes) - Gigabyte (GB): 10^9 bytes (1,000,000,000 bytes) Closes: #27580 (cherry picked from commit 9e13a8b)
- Loading branch information
1 parent
fb14eb7
commit 1793116
Showing
4 changed files
with
58 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
|
||
import { formatSize } from './format-bytes'; | ||
|
||
describe('formatSize', () => { | ||
it('1000 bytes to be 1kB', () => { | ||
expect(formatSize(1000)).toBe('1.00 kB'); | ||
}); | ||
|
||
it('1_000_000 bytes to be 1MB', () => { | ||
expect(formatSize(1_000_000)).toBe('1.00 MB'); | ||
}); | ||
|
||
it('1_500_000 bytes to be 1.5MB', () => { | ||
expect(formatSize(1_500_000)).toBe('1.50 MB'); | ||
}); | ||
|
||
it('1_000_000_000 bytes to be 1GB', () => { | ||
expect(formatSize(1_000_000_000)).toBe('1.00 GB'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters