News for hackers. Stuff that matters.
Re:Ask HN: Is there a React test framework that actually works? by morbicer on Saturday May 25, 2024 @03:07AM (#40473189)
Exactly this. Unless your product is components (e.g. you are in a team building UI kit) it's better to have unit tests for util functions and integration/e2e tests in Playwright or Cypress.

We try to avoid logic directly in components so apart from few exceptions (like complex tree pickers) it's moot to test them. For these few exceptions RTL serves us pretty well.

Testing redux reducers was cleaner back in time but hooks can be tested with renderHook/act and that's where your logic should be.

There are no comments on this comment yet.