Lesson 03 - Testing react apps

This project was bootstrapped with Create React App.

The goal

Learn how to write, fix, execute & understand tests in a React application.

Tips

Follow the Four rules of simple design

  1. Tests Pass - All test should always pass when you change any software
  2. Expresses Intent - Always reveal your intent when you write software. This means that all names, variables, methods, classes, modules...
  3. No Duplication (DRY)
  4. Small - The final rule is that all you create should be small. This means small methods, small parameter lists, small classes and small modules.

Get familiar with Jest · Painless JavaScript Testing - Facebook Code and Enzyme

Practise & learn

Fork & clone it on your machine, then in the project directory:

npm install # takes some time to complete
npm start
npm test

Useful resources:

[tutorial] Learn TDD

[online] tddbin

[videos] Test JavaScript with Jest

[article] TDD the RITE Way

[article] 5 Common Misconceptions About TDD & Unit Tests

[article] The Right Way to Test React Components

[article] Good Practices for Testing React Apps