Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | 6x 14x 6x 6x | import { render, type RenderOptions } from "@testing-library/react";
import type { ReactElement } from "react";
import { AllProviders, AuthWrapper, RouterWrapper } from "./wrappers";
// Custom render function with all providers
const testWrapperRender = (
ui: ReactElement,
options?: Omit<RenderOptions, "wrapper">
) => render(ui, { wrapper: AllProviders, ...options });
// Render with router only
export const renderWithRouter = (
ui: ReactElement,
options?: Omit<RenderOptions, "wrapper">
) => render(ui, { wrapper: RouterWrapper, ...options });
// Render with auth only
export const renderWithAuth = (
ui: ReactElement,
options?: Omit<RenderOptions, "wrapper">
) => render(ui, { wrapper: AuthWrapper, ...options });
// Re-export everything from testing-library
export * from "@testing-library/react";
// Export the main render function
export { testWrapperRender };
|