- 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%.
hey @cylcrow, it depends on one's perspective. I also think it is possible to start doing TDD for legacy code when building new features, fixing bugs and adding the new corresponding tests. The obvious reason here is that you are starting a new development.
For that code with no tests, you can think of the business logic already built at the code as a black box and write your unit tests, if something fails you can start from there applying TDD, but this scenario would start for sure with the approach "code-then-test".