Skip to content

Instantly share code, notes, and snippets.

@erickwize
Created March 9, 2021 00:03
Show Gist options
  • Save erickwize/59c8cee692b6cbd1e2f25673c1e88cf9 to your computer and use it in GitHub Desktop.
Save erickwize/59c8cee692b6cbd1e2f25673c1e88cf9 to your computer and use it in GitHub Desktop.
Mini-Challenge 2: Intro to Testing

Mini-Challenge 2: Intro to Testing

Answer the following questions first

  1. Using create-react-app, what do we need to set up for testing?
  2. What components are worth to test in your development?
  3. Can you apply TDD once you already created components?

The Challenge

NOTE: Apply TDD as much as you can.

  1. Find any sub-routine, extract that logic into a separate file and test it out.
  2. Run test coverage and save results into a .txt file at ./ - root level. Can you make the total coverage to be above of 60%?

Acceptance Criteria

  • Meaningful test cases were implemented for components and sub-routines logic.
  • All the test cases were successful.

Bonus Points

  • Test coverage is above 60%.
@AlanCantabrana
Copy link

Using create-react-app, what do we need to set up for testing?

  1. Create a folder with the following name test
    2.Create a file with .test.js extension.
  2. Add the following script to our package.json : "test:coverage": "npm run test -- --coverage --watchAll",

What components are worth to test in your development?
For now, each component we have created for our home page and its child components.

Can you apply TDD once you already created components?
Sure, we can make changes if we do not have a successful test for our components and test it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment