Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

Commit

Permalink
chore: bump pretty-ms (#398)
Browse files Browse the repository at this point in the history
* chore: bump pretty-ms

* fix: unit test

* fix: Add unit test for colonNotation
  • Loading branch information
villebro authored Apr 28, 2020
1 parent 2c3fe61 commit 771cf20
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/superset-ui-number-format/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"dependencies": {
"@types/d3-format": "^1.3.0",
"d3-format": "^1.3.2",
"pretty-ms": "^6.0.1"
"pretty-ms": "^7.0.0"
},
"peerDependencies": {
"@superset-ui/core": "^0.12.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ describe('createDurationFormatter()', () => {
expect(formatter(90)).toBe('1m 30s');
});
it('format milliseconds in human readable format with additional pretty-ms options', () => {
const colonNotationFormatter = createDurationFormatter({ colonNotation: true });
expect(colonNotationFormatter(10500)).toBe('0:10.5');
const zeroDecimalFormatter = createDurationFormatter({ secondsDecimalDigits: 0 });
expect(zeroDecimalFormatter(10500)).toBe('11s');
expect(zeroDecimalFormatter(10500)).toBe('10s');
const subMillisecondFormatter = createDurationFormatter({ formatSubMilliseconds: true });
expect(subMillisecondFormatter(100.40008)).toBe('100ms 400µs 80ns');
});
Expand Down

1 comment on commit 771cf20

@vercel
Copy link

@vercel vercel bot commented on 771cf20 Apr 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.