mirror of
https://github.com/alexgetmancom/miband-bot.git
synced 2026-09-05 18:16:18 +03:00
fix sync reliability and runtime handling
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, test } from "bun:test";
|
||||
import { esc, minutes, stepBar } from "../src/bot/formatting.js";
|
||||
import { epoch, esc, minutes, stepBar } from "../src/bot/formatting.js";
|
||||
|
||||
describe("bot formatting", () => {
|
||||
test("escapes Telegram HTML and formats health values", () => {
|
||||
@@ -7,4 +7,10 @@ describe("bot formatting", () => {
|
||||
expect(minutes(396)).toBe("6 h 36 min");
|
||||
expect(stepBar(5000)).toContain("50%");
|
||||
});
|
||||
|
||||
test("formats timestamps in the configured timezone", () => {
|
||||
const timestamp = Date.parse("2026-08-12T00:00:00Z") / 1000;
|
||||
expect(epoch(timestamp, false, "en", "UTC")).toContain("00:00");
|
||||
expect(epoch(timestamp, false, "en", "Europe/Moscow")).toContain("03:00");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user