From d63498569800511a5babc34e80141460903c308b Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Thu, 15 Feb 2018 17:55:37 -0500 Subject: [PATCH] Setting environment reported to Sentry separate from NODE_ENV For preview and prod, NODE_ENV is "production" --- src/setup/raven.js | 2 +- src/setup/raven.test.js | 2 +- webpack.common.js | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/setup/raven.js b/src/setup/raven.js index 9778ce8..2c74d4e 100644 --- a/src/setup/raven.js +++ b/src/setup/raven.js @@ -3,7 +3,7 @@ import Raven from 'raven-js'; const setupRaven = () => { Raven.config(process.env.SENTRY_KEY, { whitelistUrls: [/https:\/\/(.*\.)?regexper\.com/], - environment: process.env.NODE_ENV, + environment: process.env.DEPLOY_ENV, debug: (process.env.NODE_ENV !== 'production'), release: process.env.BUILD_ID }); diff --git a/src/setup/raven.test.js b/src/setup/raven.test.js index 49c01f0..e63fcb6 100644 --- a/src/setup/raven.test.js +++ b/src/setup/raven.test.js @@ -15,7 +15,7 @@ describe('setupRaven', () => { }); it('sets the environment', () => { - process.env.NODE_ENV='test environment'; + process.env.DEPLOY_ENV='test environment'; setupRaven(); expect(Raven.config).toHaveBeenCalledWith(expect.anything(), expect.objectContaining({ environment: 'test environment' diff --git a/webpack.common.js b/webpack.common.js index 2f78277..a263857 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -50,6 +50,7 @@ module.exports = { plugins: [ new webpack.EnvironmentPlugin({ NODE_ENV: 'development', + DEPLOY_ENV: 'development', GA_PROPERTY: null, SENTRY_KEY: null, BANNER: process.env.NODE_ENV === 'production' ? null : (process.env.NODE_ENV || 'development'),