🐯 A workshop repository for testing React ⚛ with Mocha ☕ --> slides
MIT License
Find slides here
This is a workshop for learning how to test React with the Mocha testing framework and the Enzyme testing library. It also uses Chai for helpful assertions
This project assumes you have NodeJS v6 or greater installed. You should also have npm v3 or greater installed as well (this comes packaged with Node 6). You'll also need a recent version of git installed as well.
You may have come to this project from different varying sources. There are a different series of branches for each workshop/course I've done. To get started with the project, start with this:
npm run setup
If you need help with these steps, you might check out this free Egghead.io course which can help you get things going.
If the npm run setup
script finishes without errors (don't worry about warnings) then you're
good to go. Otherwise, please file an issue.
There are two directories in this project that you should be interested in:
app
: Where the unfinished tests are (where you should add your tests).app-final
: Where the finished tests are (where you can reference if you get stuck).The tests in app
are actually all scaffolded for you. So your goal is to go through and write all the tests. Do this:
npm run watch:test
which will start running the tests in watch mode, meaning that as you save your file, itapp
directory that ends in .test.js
and implement the tests by changingit.skip(
to it(
one-by-one.Good luck!
MIT