riot-test-utils
Version:
lightweight testing utility of Riot
16 lines (15 loc) • 464 B
TypeScript
export interface ReactTestElement {
type: string;
props: ReactProps;
children: ReactTestChild[];
$$typeof?: Symbol;
}
export interface ReactProps {
[name: string]: any;
}
export declare type ReactTestChild = ReactTestElement | string | number | null;
/**
* Transform to object-tree for snapshot testing
* which is compatible to "react.test.json" in Jest.
*/
export default function toJSON(element: Element): ReactTestElement;