adhywiranata / react-jest-tdd

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 ? πŸ“·

About

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


Languages

Language:JavaScript 87.2%Language:HTML 10.2%Language:CSS 2.6%