title: How to determine if JEST is running the code or not?
body: <p>I am creating a JS test on my react-native project. I'm specifically using firebase for react native, in which I would like to replace firebase instance with a mockfirebase instance if JS is running the code of my class.</p>
  
  <p>For example I have class setup like below.</p>
  
  <pre><code>import firebase from 'react-native-firebase';
  class Database() {
      /// use the firebase instance
  }
  </code></pre>
  
  <p>I'd like to have a check if jest is the running environment then I'd replace the import line with appropriate mock class.</p>