title: Mocking react-native-async-storage on Jest
body: <p>I am testing functions which depend on <code>@react-native-community/async-storage</code>, so obviously my tests must mock that library.</p>
  
  <p>And so I do this inside of my <code>jestSetupFile.js</code>:</p>
  
  <pre><code>import mockAsyncStorage from '@react-native-community/async-storage/jest/async-storage-mock';
  jest.mock('@react-native-community/async-storage', () =&gt; mockAsyncStorage);
  </code></pre>
  
  <p>Which is direct instruction from <a href="https://github.com/react-native-community/react-native-async-storage/blob/master/docs/Jest-integration.md" rel="noreferrer">https://github.com/react-native-community/react-native-async-storage/blob/master/docs/Jest-integration.md</a></p>
  
  <p>However, the file being exported has <code>type</code> keywords, which my JavaScript environment cannot parse:</p>
  
  <pre><code>  ● Test suite failed to run
  
      /Users/someuser/myprojects/myproject/node_modules/@react-native-community/async-storage/jest/async-storage-mock.js:6
      type KeysType = Array&lt;string&gt;;
           ^^^^^^^^
  
      SyntaxError: Unexpected identifier
  </code></pre>
  
  <p>Sure enough, when I inspect the <code>async-storage-mock.js</code> file at that path, it contains the <code>type</code> keywords, which I believe are the root cause of this issue.</p>
  
  <p>What am I doing wrong here? </p>