mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-10 22:20:14 +00:00
fix(cli): preserve snapshot timestamp precision (#2494)
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user