Last active
May 7, 2021 00:31
-
-
Save mauriciomutte/ad3b4425751f38c8cf3da525fa5356a9 to your computer and use it in GitHub Desktop.
Testing-library + styled-components + Typescript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ReactElement } from 'react'; | |
import { ThemeProvider } from 'styled-components'; | |
import { render, RenderOptions } from '@testing-library/react'; | |
import theme from 'styles/theme'; | |
type CustomRenderProps = Omit<RenderOptions, 'queries'>; | |
const customRender = (ui: ReactElement, options: CustomRenderProps = {}) => | |
render(<ThemeProvider theme={theme}>{ui}</ThemeProvider>, options); | |
export * from '@testing-library/react'; | |
export { customRender as render }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment