Build frames at the given times; `at(time)` supplies per-selector samples + liveness.
(
times: number[],
at: (time: number) => {
data?: Record<string, FrameSample | null>;
liveness?: Record<string, string>;
},
)
| 29 | |
| 30 | /** Build frames at the given times; `at(time)` supplies per-selector samples + liveness. */ |
| 31 | function frames( |
| 32 | times: number[], |
| 33 | at: (time: number) => { |
| 34 | data?: Record<string, FrameSample | null>; |
| 35 | liveness?: Record<string, string>; |
| 36 | }, |
| 37 | ): MotionFrame[] { |
| 38 | return times.map((time) => { |
| 39 | const { data = {}, liveness = {} } = at(time); |
| 40 | return { time, data, liveness: { "*": "x", ...liveness } }; |
| 41 | }); |
| 42 | } |
| 43 | |
| 44 | describe("appearsBy", () => { |
| 45 | const assertion: MotionAssertion = { kind: "appearsBy", selector: "#h", bySec: 0.5 }; |