👋 hi there! My name is Kent C. Dodds! This is a workshop repo to teach you how to test your Node.js Apps!
All of these must be available in your
PATH. To verify things are set up
properly, you can run this:
git --version node --version yarn --version # or npm --version
If you want to commit and push your work as you go, you'll want to fork first and then clone your fork rather than this repo directly.
After you've made sure to have the correct things (and versions) installed, you should be able to just run a few commands to get set up:
git clone https://github.com/kentcdodds/testing-node-apps.git cd testing-node-apps node setup
This may take a few minutes. It will ask you for your email. This is optional and just automatically adds your email to the links in the project to make filling out some forms easier.
If you get any errors, please read through them and see if you can find out what the problem is. If you can't work it out on your own then please file an issue and provide all the output from the commands you ran (even if it's a lot).
If you can't get the setup script to work, then just make sure you have the right versions of the requirements listed above, and run the following commands:
npm install npm run validate
It's recommended you run everything locally in the same environment you work in every day, but if you're having issues getting things set up, you can also set this up using GitHub Codespaces (video demo) or Codesandbox.
This is the backend for Bookshelf. I recommend you play around with it a little bit to get an idea of the kind of data we're dealing with here.
For convenience, our we return a
bookobject on each list item which is the book it's associated to. You're welcome frontend folks!
/me wishes we could use GraphQL
This will start Jest in watch mode. Read the output and
play around with it. You'll be working in the
src/**/__tests__/[title].md: Background, Exercise Instructions, Extra Credit
src/**/__tests__/[title].exercise.js: Exercise with Emoji helpers
src/**/__tests__/[title].final.js: Final version
src/**/__tests__/[title].final.extra-#.js: Final version of extra credit
src/**/[title].js: The source file that you'll be testing
The purpose of the exercise is not for you to work through all the material. It's intended to get your brain thinking about the right questions to ask me as I walk through the material.
Here's the order of exercises we'll be doing as well as where you can find the markdown file associated with each.
Each exercise has comments in it to help you get through the exercise. These fun emoji characters are here to help you.
If you're confident that your system meets the system requirements above, then you can skip the system validation and manually setup the project:
npm install npm run validate
If those scripts fail, please try to work out what went wrong by the error message you get. If you still can't work it out, feel free to open an issue with all the output from that script. I will try to help if I can.
Thanks goes to these wonderful people (emoji key):
Kent C. Dodds
💻 📖 🚇 ⚠️
This project follows the all-contributors specification. Contributions of any kind welcome!
Each exercise has an Elaboration and Feedback link. Please fill that out after the exercise and instruction.
At the end of the workshop, please go to this URL to give overall feedback. Thank you! https://kcd.im/tna-ws-feedback