import React from 'react'; import { ThemeProvider } from 'styled-components'; import { render } from '@testing-library/react'; import myTheme from './theme'; const getThemeProviderWrappingComponent = (theme: Record) => ( children: React.ReactNode, ) => {children}; const renderwWithTheme = ( tree: React.ReactNode, theme: Record = myTheme, ) => { return render(getThemeProviderWrappingComponent(theme)(tree)); }; export default renderwWithTheme;