From c94618da04f0814f127b8617f3a7fac2f8c2ad07 Mon Sep 17 00:00:00 2001 From: Aruna Herath Date: Thu, 8 Dec 2016 19:19:14 +0530 Subject: [PATCH] Check if stories are loaded from Jest Jest sets userAgent to something like `Node.js (darwin; U; rv:v6.7.0) AppleWebKit/537.36 (KHTML, like Gecko)` --- src/client/preview/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/preview/index.js b/src/client/preview/index.js index f0f3b706fa2e..5c392a89df93 100644 --- a/src/client/preview/index.js +++ b/src/client/preview/index.js @@ -14,7 +14,7 @@ import reducer from './reducer'; // check whether we're running on node/browser const { navigator } = global; -const isBrowser = navigator && navigator.userAgent !== 'storyshots'; +const isBrowser = navigator && navigator.userAgent !== 'storyshots' && !navigator.userAgent.includes('Node.js'); const storyStore = new StoryStore(); const reduxStore = createStore(reducer);