From 59b6945fee847145f652fc42c227f6ce2bb62dc8 Mon Sep 17 00:00:00 2001 From: felixlinker Date: Sun, 21 Oct 2018 23:43:56 +0100 Subject: [PATCH] Allow testmode for ReactGA --- src/app/Router.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/app/Router.js b/src/app/Router.js index eb52d8df..bc1c2611 100644 --- a/src/app/Router.js +++ b/src/app/Router.js @@ -1,6 +1,13 @@ +// Check whether a test is run because then we need to +// initialize ReactGA in test mode +let isTest = false; +try { + isTest = process.env.node_env === 'test'; +} catch (e) {} + import Persist from './stores/Persist'; import ReactGA from 'react-ga'; -ReactGA.initialize('UA-55840909-18'); +ReactGA.initialize('UA-55840909-18', { testMode: isTest }); let standalone = undefined; /**