docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Create a utility that parses JSX source and produces evaluated prop snapshots for a given component.
componentName, returning one entry per element in document order. @testpropNames; missing props are omitted. Boolean shorthand and string "true" / "false" convert to booleans; literal numbers and strings are preserved. @testnull while other props remain intact. @testexport interface PropSnapshot {
elementIndex: number;
props: Record<string, any>;
}
export function generatePropSnapshots(
sourceCode: string,
componentName: string,
propNames: string[]
): PropSnapshot[];Evaluates JSX prop values into JavaScript equivalents and assists with JSX attribute access.