No description or website provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
exercises-final no semicolons needed Oct 21, 2016
exercises
scripts upgrade deps and add a verify/install script Dec 8, 2016
templates no semicolons needed Oct 21, 2016
.babelrc WIP: initial commit Sep 4, 2016
.editorconfig WIP: initial commit Sep 4, 2016
.eslintignore
.eslintrc
.gitignore Removed old line refering to nyc in .gitignore Nov 7, 2016
INSTRUCTIONS.md
LICENSE WIP: initial commit Sep 4, 2016
README.md docs: add codesponsor.io Sep 2, 2017
package.json upgrade deps and add a verify/install script Dec 8, 2016
yarn.lock upgrade deps and add a verify/install script Dec 8, 2016

README.md

React + Jest + Enzyme = ❤️

slides-badge PRs Welcome Donate

Sponsor

Find slides here

This is a workshop for learning how to test React with the Jest testing framework and the Enzyme testing library.

Project Setup

This project assumes you have NodeJS v6 or greater installed. It's also recommended to use the yarn client (rather than npm). If you'd rather stick with npm, that's fine. Just replace yarn with npm in the instructions below and hope that things don't break 😏. You'll also need a recent version of git installed as well.

With that, run:

git clone https://github.com/kentcdodds/react-jest-workshop.git
cd react-jest-workshop
yarn run setup

If the yarn run setup script finishes without errors (don't worry about warnings) then you're good to go. Otherwise, please file an issue.

Testing Instructions

There are two directories in this project that you should be interested in:

  • exercises: Where the unfinished tests are (where you should add your tests).
  • exercises-final: Where the finished tests are (where you can reference if you get stuck).

The tests in exercises are actually all scaffolded for you. So your goal is to go through and write all the tests. Do this:

  1. Run yarn run watch:test which will start running the tests in watch mode, meaning that as you save your file, it will automatically re-run your tests so you can quickly see how you're doing.
  2. Choose a file in the exercises directory that ends in .test.js and implement the tests one-by-one.

Good luck!

LICENSE

MIT