/testing-react-apps

Demo project that shows how to use the three levels of testing on a React application

Primary LanguageJavaScriptMIT LicenseMIT

Mastering React: How To Test Your React Application

Greenkeeper badge tested with jest

Testing Front End applications can be hard to wrap your head around. We will dig into how we test new React features for high traffic web applications using Jest, and Enzyme. We will cover the three levels of testing:��

  1. Unit testing React
  2. Behavioral testing our interactive React Components
  3. Integration testing our entire application.

Slides: Mastering React: How To Test Your React Application Slides

Getting Started

  • Run npm install && npm start

Run Unit/Integration Tests

  • Run npm test

Running E2E Tests

  1. Download latest selenium standalone server

     curl -O http://selenium-release.storage.googleapis.com/3.5/selenium-server-standalone-3.8.1.jar
    
  2. Download the latest version geckodriver

     curl -L https://github.com/mozilla/geckodriver/releases/download/v0.16.0/geckodriver-v0.16.0-macos.tar.gz | tar xz
    
  3. Run npm start

  4. In a new terminal, run npm run start:selenium

  5. In a new terminal, run npm run test:e2e

Contributing

Don't hesitate to create a pull request. Every contribution is appreciated. In development you can start the tests by calling npm test. Checkout our contribution README for more info.

Maintainers


Joe Karlsson