mirror of
https://github.com/plasmabit/timethings.git
synced 2026-07-22 09:00:29 +00:00
15 lines
392 B
TypeScript
15 lines
392 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { normalizeUpdateInterval } from "../src/shared/config";
|
|
|
|
describe("normalizeUpdateInterval", () => {
|
|
it.each([
|
|
["1000", 1000],
|
|
["abc", 1000],
|
|
[50, 100],
|
|
[2500.7, 2501],
|
|
[Number.NaN, 1000],
|
|
[undefined, 1000],
|
|
])("normalizes %j to %d", (value, expected) => {
|
|
expect(normalizeUpdateInterval(value)).toBe(expected);
|
|
});
|
|
});
|