import { isObject } from "reakit-utils"; export const jestSerializerStripFunctions: jest.SnapshotSerializerPlugin = { test: (val) => isObject(val) && !Array.isArray(val) && Object.values(val).find((v) => typeof v === "function"), print: (val: any, serialize) => serialize( Object.keys(val) .filter((key) => typeof val[key] !== "function") .reduce( (acc, curr) => ({ ...acc, [curr]: val[curr], }), {} ) ), };