Logo Awesome React

Awesome React

Set up Enzyme, expect, and mocha for Unit Testing

NOTE: I did skip one step here relating to installing Babel and adding the mocha.opts which is what enables the ES6 modules syntax as well as any ES6+ features. See https://github.com/erikthedeveloper/example-react-app-react-mail/pull/6 for a short summary and complete code examples.

We'll walk through setting up tooling for testing React components. AirBnb's Enzyme for shallow rendering, expect for assertions and spies, and mocha as our test runner. Then we will write our first unit test to make sure that our tooling is all set up and we can run tests via mocha.