import { render } from "@testing-library/react";
export function checkForRenderErrors(errorList) {
    const ignoreErrorStrings = [
        "Warning: Failed prop type: The prop `rows`",
        "Warning: Failed prop type: The prop `rowsMax`",
        "Warning: React does not recognize the `%s` prop on a DOM element",
        "Error: Not implemented: HTMLCanvasElement.prototype.getContext",
        "Failed prop type: Invalid prop `children[1]` of type `array` supplied to `ForwardRef(TabList)`",
        "Warning: Failed %s type: %s%s",
        "Material-UI:",
        "Warning: A component is changing an uncontrolled input of type",
    ];
    expect(errorList.filter((e) => {
        return !ignoreErrorStrings.find((ignoreStr) => (e || "").includes(ignoreStr));
    })).toHaveLength(0);
}
const customRender = (ui, options) => {
    let errorList = [];
    const renderError = (output) => {
        errorList.push(output);
    };
    const renderWarn = (output) => {
        errorList.push(output);
    };
    const renderLog = (output) => { };
    const originalError = console.error;
    const originalWarn = console.warn;
    const originalLog = console.log;
    console.error = renderError;
    console.warn = renderWarn;
    console.log = renderLog;
    const content = render(ui, options);
    console.error = originalError;
    console.warn = originalWarn;
    console.log = originalLog;
    checkForRenderErrors(errorList);
    return content;
};
// re-export everything
export * from "@testing-library/react";
// override render method
export { customRender as render };
//# sourceMappingURL=test-utils.js.map