// A simulation time as Java's viewers write the wall clock: HH:mm:ss, and // with milliseconds for the dropped frames (Lauscher.formatTimestamp), in the // viewer's time zone. import { describe, expect, it } from 'vitest'; import { timeOfDay } from '../src/simulation/timeOfDay.js'; describe('a time of day', () => { it('pads hours, minutes, seconds and milliseconds as Java does', () => { const clock = new Date(2026, 9, 3, 7, 5, 3, 4).getTime(); expect(timeOfDay(clock, 0)).toBe('07:05:03'); expect(timeOfDay(clock, 0, true)).toBe('07:05:03.004'); expect(timeOfDay(clock, 56_996 + 3_600_000 * 15, true)).toBe('22:06:00.000'); expect(timeOfDay(clock, 96, true)).toBe('07:05:03.100'); }); });