-
Notifications
You must be signed in to change notification settings - Fork 11
Add process uptime to harper status
#2209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f4574dc
18376a5
486f08d
421f29e
a2250f3
7f3fa5e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -586,6 +586,28 @@ describe('Test common_utils module', () => { | |
| }); | ||
| }); | ||
|
|
||
| describe('Test prettyDuration', () => { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These newly added tests continue the legacy Chai style, while the repository requires new tests to import bare node:assert and use assert.strictEqual or assert.deepStrictEqual where needed. Please convert the added assertions while leaving the older suite untouched. — KrAIs (Codex) |
||
| it('drops only leading zero units', () => { | ||
| assert.strictEqual(cu.prettyDuration(5000), '5s'); | ||
| assert.strictEqual(cu.prettyDuration(90000), '1m 30s'); | ||
| assert.strictEqual(cu.prettyDuration(97702000), '1d 3h 8m 22s'); | ||
| }); | ||
| it('keeps interior zero units once a larger unit is present', () => { | ||
| assert.strictEqual(cu.prettyDuration(86405000), '1d 0h 0m 5s'); | ||
| }); | ||
| it('floors sub-second and non-positive values to 0s', () => { | ||
| assert.strictEqual(cu.prettyDuration(0), '0s'); | ||
| assert.strictEqual(cu.prettyDuration(999), '0s'); | ||
| assert.strictEqual(cu.prettyDuration(-5000), '0s'); | ||
| }); | ||
| it('floors non-finite values to 0s', () => { | ||
| assert.strictEqual(cu.prettyDuration(NaN), '0s'); | ||
| assert.strictEqual(cu.prettyDuration(Infinity), '0s'); | ||
| assert.strictEqual(cu.prettyDuration(-Infinity), '0s'); | ||
| assert.strictEqual(cu.prettyDuration(cu.convertToMS('abc')), '0s'); | ||
| }); | ||
| }); | ||
|
|
||
| describe('Test httpRequest timeout', () => { | ||
| const http = require('node:http'); | ||
| let server, port; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.