/react-jest-tdd

Simple experimental app to implement Testing in React using Jest (feat Airbnb's Enzyme)

Primary LanguageJavaScript

React Jest TDD (feat Airbnb's Enzyme)

Simple experimental app to implement Testing in React using Jest

Installing 🔧

npm install --save enzyme jsdom react-addons-test-utils react-test-renderer

Running Tests 🏃

npm test

this will execute a test npm script. Please check package.json file to inspect it.

Step by Step Implementation 📖

For better learning experience, we'll try covering some type of tests one by one:

Unit Tests

Just React 👷

+ Redux! 😍

  • 06 - Test Action Creators, to make sure we have created a proper action which is a plain object.
  • 07 - Test Reducers, to make sure we our reducer returns a new state as we expected.
  • 08 - Test Store, to make sure our Store do things we expect it to.
  • 09 - Test Connected Components, to finally test our redux-connected components! Warning: State, Events, and Props test will disappear on step 09 onward to integrate Redux. Please check step 08 for those tests

Snapshot Test ? 📷