5th April 2020

These last few days, I have been focusing on REACT. It has been a while ever since I did any react or frontend generally. My greatest weakness has always been testing the business logic. Since I have always done everything in the components, It has been a pain when it comes to testing, I have never gone beyond 70% code coverage due to the complexity of the logic.

This time I knew it has been different. I have been mentored in better testing methods and software development patterns. Using TDD, I embarked on my journey starting with install enzyme and writing an initial test to show that a component gets rendered and if a component is rendered by another component. I figured that to greatly test my code, I have to separate the core business. I created a class and encapsulate the logic then call the new object in the components. I don’t know if this is how some members in the react community do it but I know it’s how I am going to do it. In the same project, I got to use react hooks for the first time, I have been reading about them for a year but never got an option to use them. I don’t see the big deal about hooks, think class-based components are better. could it be that I am saying this because I am used to OOP? it could be.

That being said the future is hooks. There are still some areas of react that still give me issues while testing. It’s going to take me a while to get there but I know I will get there. That being said I will continue learning more about react this week. I will focus on architecture, data follow and better testing. Maybe late on, I will explore redux.

Previous
Previous

7th April, 2020 Output

Next
Next

Builder Design Pattern