mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-04 14:29:45 +00:00
feature: Adding in the stopping state (#2677)
* feature: Adding in the stopping state * chore: Deal with timeout in the sigterm for main * chore: Update the timeout * Update web/projects/ui/src/app/pages/apps-routes/app-list/app-list-pkg/app-list-pkg.component.ts Co-authored-by: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> * Update web/projects/ui/src/app/pages/apps-routes/app-show/components/app-show-status/app-show-status.component.ts Co-authored-by: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> --------- Co-authored-by: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com>
This commit is contained in:
34
sdk/lib/util/inMs.test.ts
Normal file
34
sdk/lib/util/inMs.test.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { inMs } from "./inMs"
|
||||
|
||||
describe("inMs", () => {
|
||||
test("28.001s", () => {
|
||||
expect(inMs("28.001s")).toBe(28001)
|
||||
})
|
||||
test("28.123s", () => {
|
||||
expect(inMs("28.123s")).toBe(28123)
|
||||
})
|
||||
test(".123s", () => {
|
||||
expect(inMs(".123s")).toBe(123)
|
||||
})
|
||||
test("123ms", () => {
|
||||
expect(inMs("123ms")).toBe(123)
|
||||
})
|
||||
test("1h", () => {
|
||||
expect(inMs("1h")).toBe(3600000)
|
||||
})
|
||||
test("1m", () => {
|
||||
expect(inMs("1m")).toBe(60000)
|
||||
})
|
||||
test("1m", () => {
|
||||
expect(inMs("1d")).toBe(1000 * 60 * 60 * 24)
|
||||
})
|
||||
test("123", () => {
|
||||
expect(() => inMs("123")).toThrowError("Invalid time format: 123")
|
||||
})
|
||||
test("123 as number", () => {
|
||||
expect(inMs(123)).toBe(123)
|
||||
})
|
||||
test.only("undefined", () => {
|
||||
expect(inMs(undefined)).toBe(undefined)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user