fix(cli): preserve snapshot timestamp precision (#2494)

This commit is contained in:
Miguel Ángel
2026-07-15 15:54:27 -04:00
committed by GitHub
parent b874c4440f
commit 9e53c0f9b1
2 changed files with 17 additions and 2 deletions
@@ -2,12 +2,22 @@ import { describe, expect, it } from "vitest";
import { readFileSync } from "node:fs";
import {
computeSnapshotTimes,
formatSnapshotTimestamp,
parseZoomScale,
requireSnapshotFfmpeg,
resolveSnapshotVideoFrameTime,
tailFrameTime,
} from "./snapshot.js";
describe("formatSnapshotTimestamp", () => {
it.each([
[1.12, "1.12s"],
[0.30000000000000004, "0.3s"],
])("formats %s without discarding useful precision", (time, expected) => {
expect(formatSnapshotTimestamp(time)).toBe(expected);
});
});
// --zoom's crop-region math (selector bbox + padding + clamp, exact region
// form, no-match error) is owned by and tested in
// ../capture/captureCompositionFrame.test.ts alongside its implementation.