/** * Test-only DSL for the Elm-store idiom (CLAUDE.md #3). A fixture is built by * replaying real `Msg`s through the real `reduce` — never by hand-assembling a * state object field-by-field. That closes off illegal states the reducer would * never actually produce: if a spec can't reach a state via messages, it can't * assert on it either. * * `given(reduce, initial)` partially applies a machine's reducer + starting * state; the result is a variadic replay function a spec calls with the exact * message sequence a real user/flow would send. */ export const given = (reduce: (s: S, m: M) => S, initial: S) => (...msgs: M[]): S => msgs.reduce(reduce, initial);