Unit Testing React Applications

Created by Omer Wazir / @thewazir

Disclaimer

I never said I was a unit testing genius

Part I

  • why bother with unit testing?
  • ways to catch mistakes
  • a few unit test frameworks
  • Try to prefer simple tools
  • browser vs headless testing
  • cross Browser testing
  • testing with ES6

Why bother with unit testing?

Ways to catch mistakes

A few unit test frameworks

  • Jasmine
  • QUnit
  • Mocha
  • Tape
  • Jest

Try to prefer simple tools

Browser vs headless testing

Cross Browser testing

  • Browserstack
  • Sauce Labs

Testing with ES6

Part II

  • starting with the simplest component
  • adding more components
  • showing some features of TestUtils
  • simulating events
  • topics for another time

Starting with the simplest component

checkout step-2

Adding more components

checkout step-3

Showing some features of TestUtils

checkout step-4

Simulating Events

checkout step-5

spoiler: doesn't really work as advertised

Topics for another time

  • mocking, spying, stubbing
  • integration tests
  • capturing pixels
  • continuous integration...in the cloud...

Questions?