Skip to content

Instantly share code, notes, and snippets.

@julsfelic
Created June 3, 2016 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save julsfelic/f78dbd0501eb770a1c30f0440468bf7b to your computer and use it in GitHub Desktop.
Save julsfelic/f78dbd0501eb770a1c30f0440468bf7b to your computer and use it in GitHub Desktop.
Testing React components with Jest

Testing React Components with Jest

What is Jest?

  • Built by the FB team for the purpose of testing their React components.
  • Built on top of Jasmine.

Getting Setup with Jest

  • Adding Jest to your project
  • Getting a basic test up an running to make sure we set up Jest properly.

Basic testing of a component

  • Writing a basic test to see if our component was mounted
  • What is TestUtils and how can we utilize it for testing

More advanced testing

  • Passing in props and making sure the components are rendering with the correct props.
  • Testing state? Haven't gotten to learning to much about this yet.

Other resources for learning about Jest and React testing as a whole

  • Links go here

Final thoughts

  • What I think of testing with Jest.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment