- Using
create-react-app
, what do we need to set up for testing? - What components are worth to test in your development?
- Can you apply TDD once you already created components?
NOTE: Apply TDD as much as you can.
- Find any sub-routine, extract that logic into a separate file and test it out.
- Run test coverage and save results into a .txt file at ./ - root level. Can you make the total coverage to be above of 60%?
- Meaningful test cases were implemented for components and sub-routines logic.
- All the test cases were successful.
- Test coverage is above 60%.
1. Using create-react-app, what do we need to set up for testing?
I believe it already includes Jest, so we-re all set up!
2. What components are worth to test in your development?
I think that those that are going to deal with different kinds of inputs, specially those that come from the final user, are very important, so the events. Also checking that it renders properly, the props are passed correctly and the edge cases are quite worth the effort in my opinion.
3. Can you apply TDD once you already created components?
I don't think it can be done retroactively but, if needed, we can include it in further iterations of a product.