Moved a few vars inside of the setupTest beforeEach block
Brian Vaughn committed
Apr 11, 2019 at 11:38 UTC
e0ffa2b88d18e1df66c7b69b6a1ad24b3058be42
1 file changed
+3
-7
src/__tests__/setupTests.js
+3
-7
@@ -6,10 +6,6 @@ import Bridge from 'src/bridge';
6
import Store from 'src/devtools/store';
7
import { installHook } from 'src/hook';
8
9
-let agent;
10
-let bridge;
11
-let bridgeListeners;
12
-
9
// Mimic the global we set with Webpack's DefinePlugin
10
global.__DEV__ = process.env.NODE_ENV !== 'production';
11
@@ -24,9 +20,9 @@ env.beforeEach(() => {
20
21
installHook(global);
22
27
- bridgeListeners = [];
23
+ const bridgeListeners = [];
24
29
- bridge = new Bridge({
25
+ const bridge = new Bridge({
26
listen(callback) {
27
bridgeListeners.push(callback);
28
},
@@ -35,7 +31,7 @@ env.beforeEach(() => {
31
},
32
});
33
38
- agent = new Agent();
34
+ const agent = new Agent();
35
agent.addBridge(bridge);
36
37
initBackend(global.__REACT_DEVTOOLS_GLOBAL_HOOK__, agent, global);