serializeForSnapshot
serializeForSnapshot(
result,options?):Record<string,unknown>
Creates a deterministic serializable form of a RunResult for snapshot comparison.
Sorts state keys alphabetically, excludes specified keys, and produces a plain object suitable for Vitest’s built-in snapshot matching.
Parameters
Section titled “Parameters”result
Section titled “result”Pick<RunResult, "text" | "state"> & object
The run result (or any object with text, state, data)
options?
Section titled “options?”Optional exclusion list for state keys
Returns
Section titled “Returns”Record<string, unknown>
Deterministic plain object