Testing Gatsby

Gatsby enables unit testing—testing that evaluates atomic units of functionality—with limited additional setup through Jest. The Jest framework can be used on its own for snapshot testing—testing that compares visual states of the application to track regressions in the user experience—and in conjunction with other libraries for unit testing of React components and components containing GraphQL queries.

But these aren’t the only kinds of testing that can be performed on Gatsby sites. The field of testing in web development has seen an explosion of innovation in recent years, with other techniques like visual regression testing (evaluating differences due to changes in visual application behavior) and end-to-end testing (evaluating whether an application functions correctly from beginning to end) made available by emerging ecosystems. In this section, we’ll cover how to unit-test with Jest and perform other types of testing with other tools.

NOTE

It’s also possible to use Google Analytics in conjunction with Netlify to perform A/B or split testing (evaluating two different online states of an application to compare them against each other) on a Gatsby site, a procedure that is well beyond the scope of this app. Consult the A/B testing guide in the Gatsby documentation for a walkthrough.


Posted

in

,

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *