I'm trying to figure out what should the return type be (instead of generic : any) for the utilities returned by Testing Library React.
For example, with the following, I get TS error (Unexpected any. Specify a different type.)
const setup = (): any => {
//~~~~~ Unexpected any. Specify a different type.
const utils = render(
...
);
const button = utils.getByText(/some text/i);
return { button, ...utils };
};
test('it renders', () => {
const { button } = setup();
expect(button).toBeInTheDocument();
});