nicklima/strapi-blog-frontend-next

View on GitHub
.jest/utils.tsx

Summary

Maintainability
A
0 mins
Test Coverage
import { render, RenderOptions } from "@testing-library/react"
import { ReactElement, ReactNode } from "react"
import { ThemeProvider } from "styled-components"
import { theme } from "styles"

const AllTheProviders = ({ children }: { children: ReactNode }) => {
  return <ThemeProvider theme={theme}>{children}</ThemeProvider>
}

const customRender = (
  ui: ReactElement,
  options?: Omit<RenderOptions, "wrapper">
) => render(ui, { wrapper: AllTheProviders, ...options })

export * from "@testing-library/react"
export { customRender as render }