Practical TDD for React
Practical TDD for React is a workshop focused on teaching a practical approach to TDD. I really want to emphasize the practical aspect of it. We won't be doing what most people would consider a purist/conventional approach to TDD. Instead, we're going to spend a lot of time looking at workflows, tools, techniques, and tradeoffs that I believe will make TDD much more approachable for you to start practicing in your day-to-day coding and consequently, make your time more productive and enjoyable.
Please complete the items on the list below before the workshop. This will allow us to spend as much time as possible on the good stuff.
- Install all of the Dependencies
- Fork the repo.
- Clone the repo locally.
- Complete the Getting Started section.
- (Optional, but recommended) Sign up for an account on CircleCI.
- (Optional, but recommended) Setup your forked repo on CircleCI.
Please make sure you have the following installed before beginning:
- Node 10.16.x / npm 6.9.x. I highly recommend using nvm to manager your Node versions.
- yarn 1.17.x
- git: 2.22.x (a different version of git should work fine, but try installing this version if you run into issues).
- Clone the repo.
- Install the dependencies:
- Run the React component tests:
- Run the app:
- With the app still running from the previous step, run the Cypress tests:
yarn cypress run.
Cypress is an awesome tool for writing flexible E2E and integration tests. If you don't know what E2E and integration tests are, don't worry - we'll go over them in the workshop. Getting familiar with Cypress would still be very beneficial for you. You can check out the docs here. Egghead.io also has a great course that walks you through Cypress in more depth.
React Testing Library is a library developed by Kent Dodds. It's focus is on providing tools to make your React component tests act more like a user. General intro here and React Testing Library intro here. Egghead.io again has a great course for this as well.