blob: 9053be909d77f69c874803c63b7a9673dcdf0b01 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
import { AllProviders } from "@/providers";
import { render, RenderOptions } from "@testing-library/react";
import { FunctionComponent, ReactElement, StrictMode } from "react";
const AllProvidersWithStrictMode: FunctionComponent = ({ children }) => {
return (
<StrictMode>
<AllProviders>{children}</AllProviders>
</StrictMode>
);
};
const customRender = (
ui: ReactElement,
options?: Omit<RenderOptions, "wrapper">
) => render(ui, { wrapper: AllProvidersWithStrictMode, ...options });
// re-export everything
export * from "@testing-library/react";
// override render method
export { customRender as render };
export { render as rawRender };
|