Add the following to your
.happo.js configuration file:
// .happo.jsconst happoPluginGatsby = ;moduleexports =// ...plugins:type: 'plain'
The Gatsby plugin for Happo takes screenshots on pre-built Gatsby pages.
Therefore, before you run
happo run you need to run a Gatsby build. Use the
to tell Happo to build before screenshooting. This could look something like
this (using Travis CI as an example):
# .travis.ymlscript:- INSTALL_CMD="yarn build" yarn happo-ci
By default, all Gatsby pages are included in the test suite. By providing a filter function, you can exclude certain pages. Here's an example excluding all "blog" pages:
Use this option to override where Happo looks for pre-built Gatsby pages. The
path.resolve(process.cwd(), 'public'). Make sure to use an
absolute file path here.
const path = ;;