Skip to content

Commit 6f20edb

Browse files
committed
Adding a test
1 parent a9b21c7 commit 6f20edb

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/unit/filesize.test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,12 @@ describe('filesize', () => {
371371
// Some scientific notation in the final result may be acceptable for such large numbers
372372
assert(result.includes('YiB'));
373373
});
374+
375+
it('should handle precision with specific test case for GiB values', () => {
376+
// Test specific precision case: filesize(1058223158, {base: 2, standard: 'iec', precision: 3})
377+
// This should output '0.990 GiB'
378+
assert.strictEqual(filesize(1058223158, {base: 2, standard: 'iec', precision: 3}), '0.990 GiB');
379+
});
374380
});
375381

376382
describe('Edge cases', () => {

0 commit comments

Comments
 (0)