Using the custom utils file as described in the README where you re-export everything from react-testing-library and override the render method gives the following error:
TypeError: Cannot set property render of [object Object] which has only a getter
react-testing-library version: 5.0.1
react version: 16.5.0
node version: 10.0.0
npm (or yarn) version: 1.6.0
Relevant code or config:
// @flow
import * as React from 'react';
import { render } from 'react-testing-library';
const customRender = (node, ...options) => {
return render(
<div>{node}</div>,
...options,
);
};
export * from 'react-testing-library';
export { customRender as render };
This is on create-react-app by the way (react-scripts@1.1.5)
Using the custom utils file as described in the README where you re-export everything from
react-testing-libraryand override the render method gives the following error:TypeError: Cannot set property render of [object Object] which has only a getterreact-testing-libraryversion:5.0.1reactversion:16.5.0nodeversion:10.0.0npm(oryarn) version:1.6.0Relevant code or config:
This is on
create-react-appby the way (react-scripts@1.1.5)