happo/happo.io

Environment variables in CircleCI run

kyletov opened this issue · 2 comments

Is it possible to set custom environment variables in CircleCI runs? I'm trying to define an environment variable IS_HAPPO_TEST=true when a Happo test is running.

Is it possible to tell at runtime (when the page is being screenshotted) whether the current request is from Happo within our React App?

Hi @kyletov! What type of integration are you using? Environment variables are handled differently depending on the integration. For Happo examples, you'd have to inject the environment variables into the webpack bundled created by Happo, via customizeWebpackConfig. It looks like you can do this via the EnvironmentPlugin for webpack.

Hey @trotzig, I'm currently using the Happo Examples Integration. I'll try the suggestions you mentioned and update if anything comes up, thanks!

Update: It works for me! Thanks @trotzig!