uniswap-interface-uncensored/src/test-utils.tsx
Moody Salem 53da48b646
refactor: add an import sorting plugin (#2417)
* refactor: add an import sorting plugin

* Fix code style issues with ESLint

Co-authored-by: Lint Action <lint-action@samuelmeuli.com>
2021-09-21 18:21:28 -05:00

20 lines
617 B
TypeScript

import { render, RenderOptions } from '@testing-library/react'
import React, { FC, ReactElement, ReactNode } from 'react'
import { Provider } from 'react-redux'
import store from 'state'
import ThemeProvider from 'theme'
const WithProviders: FC = ({ children }: { children?: ReactNode }) => {
return (
<Provider store={store}>
<ThemeProvider>{children}</ThemeProvider>
</Provider>
)
}
const customRender = (ui: ReactElement, options?: Omit<RenderOptions, 'wrapper'>) =>
render(ui, { wrapper: WithProviders, ...options })
export * from '@testing-library/react'
export { customRender as render }