/* @flow strict */

let Reactotron; // eslint-disable-line import/no-mutable-exports

if (__DEV__ && !__TEST__) {
  // eslint-disable-next-line global-require, import/no-extraneous-dependencies
  Reactotron = require('reactotron-react-native').default;
  // eslint-disable-next-line global-require, import/no-extraneous-dependencies
  const { reactotronRedux } = require('reactotron-redux');
  Reactotron.configure()
    .useReactNative() // use all built-in react native plugins
    .use(reactotronRedux())
    .connect();
}

export default Reactotron;

/* @flow strict */

let Reactotron; // eslint-disable-line import/no-mutable-exports

const inTest = typeof __TEST__ !== 'undefined' && __TEST__;

if (__DEV__ && !inTest) {
  // eslint-disable-next-line global-require, import/no-extraneous-dependencies
  Reactotron = require('reactotron-react-native').default;
  // eslint-disable-next-line global-require, import/no-extraneous-dependencies
  const { reactotronRedux } = require('reactotron-redux');
  Reactotron.configure()
    .useReactNative() // use all built-in react native plugins
    .use(reactotronRedux())
    .connect();
}

export default Reactotron;

Fix the new Jest check to not break dev, oops.
tests: Fix the new Jest check to not break dev, oops.

After c8b4e4e04 "tests: Fix check for running in Jest.", if you try
running the app in debug mode you get a redscreen saying `__TEST__`
is not a variable.  Instead, check first whether `__TEST__` is set
at all.

This code is kind of ugly now, but at least it does seem to work,
both in Jest and in running the app in dev.  If we find ourselves
needing this check in a second spot in the app, we can factor it out
as a helper somewhere.  Or maybe there's a better way to write this
entirely. ;-)
