2020-03-07 10:20:38 -05:00
|
|
|
import "pepjs";
|
|
|
|
|
2020-02-12 02:19:43 +04:00
|
|
|
import {
|
|
|
|
render,
|
|
|
|
queries,
|
|
|
|
RenderResult,
|
|
|
|
RenderOptions,
|
|
|
|
} from "@testing-library/react";
|
|
|
|
|
|
|
|
import * as toolQueries from "./queries/toolQueries";
|
|
|
|
|
|
|
|
const customQueries = {
|
|
|
|
...queries,
|
|
|
|
...toolQueries,
|
|
|
|
};
|
|
|
|
|
|
|
|
type TestRenderFn = (
|
|
|
|
ui: React.ReactElement,
|
|
|
|
options?: Omit<RenderOptions, "queries">,
|
|
|
|
) => RenderResult<typeof customQueries>;
|
|
|
|
|
|
|
|
const renderApp: TestRenderFn = (ui, options) =>
|
|
|
|
render(ui, {
|
|
|
|
queries: customQueries,
|
|
|
|
...options,
|
|
|
|
});
|
|
|
|
|
|
|
|
// re-export everything
|
|
|
|
export * from "@testing-library/react";
|
|
|
|
|
|
|
|
// override render method
|
|
|
|
export { renderApp as render };
|