(opts?: ConstructorParameters<typeof TransportClock>[0])
| 2 | import { TransportClock } from "./clock"; |
| 3 | |
| 4 | function createClock(opts?: ConstructorParameters<typeof TransportClock>[0]) { |
| 5 | let ms = 0; |
| 6 | const clock = new TransportClock({ nowMs: () => ms, ...opts }); |
| 7 | const advance = (deltaMs: number) => { |
| 8 | ms += deltaMs; |
| 9 | }; |
| 10 | return { clock, advance, getMs: () => ms }; |
| 11 | } |
| 12 | |
| 13 | describe("TransportClock", () => { |
| 14 | describe("initial state", () => { |