title: jest unexpected identifier when I add setup files
body: <p>Why I get this error:</p>
  <pre><code>    C:\PC\node_modules\@react-native\polyfills\error-guard.js:14
      type ErrorHandler = (error: mixed, isFatal: boolean) =&gt; void;
           ^^^^^^^^^^^^
  
      SyntaxError: Unexpected identifier
  
        at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1350:14)
        at Object.&lt;anonymous&gt; (node_modules/react-native/jest/setup.js:16:6)
  </code></pre>
  <p>This comes when I add this line:</p>
  <pre><code>    &quot;setupFiles&quot;: [&quot;./node_modules/react-native-gesture-handler/jestSetup.js&quot;],
  </code></pre>
  <p>I want to test my navigation</p>
  <p>NavigationTest.js</p>
  <pre><code>import React from 'react';
  import { NavigationContainer } from '@react-navigation/native';
  import { render } from '@testing-library/react-native';
  import { NativeStackWrapper } from '../src/navigation/CurvedBottomTab';
  
  jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper');
  
  describe('test the Navigation', () =&gt; {
  
    it('should render the curved tab navigator without errors', () =&gt; {
      const { debug } = render(
      &lt;NavigationContainer&gt;
        &lt;NativeStackWrapper /&gt;
      &lt;/NavigationContainer&gt;)
  
      debug();
    });
  
  });
  </code></pre>
  <p>Package.json</p>
  <pre><code>...
    &quot;jest&quot;: {
      &quot;preset&quot;: &quot;jest-expo&quot;,
      &quot;setupFiles&quot;: [&quot;./node_modules/react-native-gesture-handler/jestSetup.js&quot;],
      &quot;transformIgnorePatterns&quot;: [
        &quot;node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg)|(?!lodash-es)&quot;
      ]
    },
  </code></pre>