maccounter
7 строк · 278.0 Байт
1import { render } from '@testing-library/react'
2import React, { ReactElement } from 'react'
3
4export const compareSnapshot = (component: ReactElement, wrapper?: React.FC) => {
5const { asFragment } = render(component, { wrapper })
6expect(asFragment()).toMatchSnapshot()
7}
8