DEV Community

loading...

Discussion on: Writing unit tests with React, Typescript, and react-testing-library

Collapse
jacobwicks profile image
jacobwicks

Nice article. I had already come up with a render function that used a base props and accepted an optional override props like this

function renderUI(props: Partial<ComponentProps> = {}) {
  return render(<Todo {...baseProps} {...props} />);
}

But the rerender was something new. I'm using it in my current project