/js-testing-example

A little React app with tests that need some ❤️.

Primary LanguageJavaScript

JavaScript Testing Workshop Example Repo

A little React app with tests that need some ❤️.

Things you'll need

  1. node. I use the popular tool nvm to install multiple versions of node and switch between them from project to project.
  2. yarn. This has become the industry standard for managing node dependencies. Installation instructions for many operating systems here. I installed mine with brew install yarn.

Running the app

It's a Create React App so you can run it in the usual way:

  • yarn install // install node dependencies
  • yarn start // run the development server
  • navigate to localhost:3000

Running tests

  • yarn test runs the unit tests in "watch mode". When you update the code, the tests will run themselves again.
  • yarn test:acceptance runs the end to end browser tests in the acceptance/ directory. We're using the Puppeteer library to launch the app server in an instance of Chromium, then visit the site and type, click, etc.

Slide deck

Here are the slides for this workshop!

Resources