Our great sponsors
-
react-hooks-testing-library
🐏 Simple and complete React hooks testing utilities that encourage good testing practices.
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
Of course, you could isolate the logic inside a hook, and there's an awesome way of testing it with renderHook. But yet, you're trapped into react features, if they change their API, you will have to put your hands in your working logic and adapt some stuffs to keep up to date.
As a reward for reading this all, here's an example of a real application. It's from a RPG character creator in which user will buy his character attribute points. At github.
Related posts
- what's your take on the tdd approach? how are tests tested ?
- Testing Functions within Functional React Components
- Testing modern ReactJS Application: Unit Testing(Part 2)
- Writing useful custom React hooks with TypeScript and testing them with React Testing Library
- I’ve been struggling a lot learning Unit Testing, any general tip?