title: Jest test case error in react-native using external plugin
body: <p>I am using react-native init to create a react-native project. I am using <a href="https://github.com/andpor/react-native-sqlite-storage" rel="noreferrer">https://github.com/andpor/react-native-sqlite-storage</a> library for SQLite bindings.</p>
  
  <p>I have a DbConnector.jest-test.js unit tests file. Contents are </p>
  
  <pre><code>import DbConnector from '../app/components/DbConnector.js';
  // Note: test renderer must be required after react-native.
  import renderer from 'react-test-renderer';
  
  it('renders correctly', () =&gt; {
  const tree = renderer.create(
  &lt;DbConnector /&gt;
  );
  });
  </code></pre>
  
  <p>When I am running jest, I am getting following error even if by default node_modules are ignored. I am using react-native preset in package.json</p>
  
  <pre><code>Test suite failed to run
  
  ReferenceError: window is not defined
  
    at Object.&lt;anonymous&gt; (node_modules/react-native-sqlite-storage/lib/sqlite.core.js:53:10)
    at Object.&lt;anonymous&gt; (node_modules/react-native-sqlite-storage/sqlite.js:10:12)
    at Object.&lt;anonymous&gt; (app/components/DbConnector.js:3:31)
  
  Test Suites: 1 failed, 1 total
  </code></pre>
  
  <p>Imports in DbConnector.js are as:</p>
  
  <pre><code>import React, { Component } from 'react'
  import { AppRegistry, StyleSheet, Text, View, TextInput, Button, Alert, 
  AsyncStorage } from 'react-native'
  import SQLite from 'react-native-sqlite-storage'
  </code></pre>