DEV Community

Discussion on: Confession: I Don't Know Where to Even Begin with Testing My Code

Collapse
 
alexlsalt profile image
Alex Morton

Jan, this is amazing — thank you so much for taking the time to write all this up. Very informative and definitely gives me a great overall view.

I’m familiar with PropTypes in React, could be a great habit to start getting into testing by adding those.

Again, thank you so much!!

Collapse
 
vier31 profile image
Jan Schröder

One way to make that habit really stick is to set up ESLint to require PropTypes and implement a pre-commit hook with Husky to not allow commits as long as there are Linzer warnings. :)

In the beginning it feels really restrictive, but once you are used to it, writing out PropTypes takes a couple of minutes.