You are here

Testing with Jest

Our front end is written in JavaScript & React, which is a JavaScript library for building user interfaces. Using Jest was an obvious testing choice for us, as Jest is an open source library used for testing JavaScript code & React applications. It requires zero configuration which meant testing sooner & delivering faster. Ideal for our microservices architecture. Jest is composed of many other packages like jest-snapshot, jest-validate etc, which makes Jest more than just a test runner with a built in assertion library. We used Jest Snapshot to test our UI components which works by taking a screenshot & compares it to a stored, reference image. The test fails if the two images do not match. We later realised that Jest Snapshot can be used for most JavaScript types including API responses, arrays, objects strings etc & not only UI components. If you are interested in learning more about Jest & Snapshot testing come join us.

Key takeaways:

  • Jest Snapshot testing
  • Component testing