title: Babel7 Jest unexpected token export
body: <p>I am having issues in running jest tests in my project with Babel7. Tests used to transpile perfectly with babel6. It also compiles perfectly with webpack with Babel7 but fails to run tests with jest due to a transpilation error. What am I doing wrong? </p>
  
  <pre><code>react/node_modules/generic-redux-root/index.js:1
  ({"Object.&lt;anonymous&gt;":function(module,exports,require,__dirname,__filename,global,jest){export * from './source/CreateReduxRoot';
                                                                                           ^^^^^^
  
  SyntaxError: Unexpected token export
  </code></pre>
  
  <p>my jest config</p>
  
  <pre><code>{
  "unmockedModulePathPatterns": [
    "&lt;rootDir&gt;/node_modules/react",
    "&lt;rootDir&gt;/node_modules/react-dom",
    "&lt;rootDir&gt;/node_modules/react-addons-test-utils",
    "&lt;rootDir&gt;/node_modules/fbjs",
    "enzyme"
  ],
  "roots": [
    "&lt;rootDir&gt;/__tests__"
  ],
  "transformIgnorePatterns": [
    "node_modules/(^generic-)/i", //a module matching this is throwing an error
    "node_modules/react-infinite-scroller"
  ],
  "setupFiles": [
    "./jestsetup.js"
  ],
  "snapshotSerializers": [
    "enzyme-to-json/serializer"
  ],
  "testResultsProcessor": "./jestTrxProcessor",
  "verbose": true
  </code></pre>
  
  <p>}</p>
  
  <p>My .babelrc</p>
  
  <pre><code>{
  "presets": [
      [
          "@babel/preset-env",
          {
              "targets": {
                  "ie": 11
              },
              "useBuiltIns": "usage"
          }
      ],
      "@babel/preset-react"
  ],
  "plugins": [
      "@babel/plugin-transform-runtime",
      "@babel/plugin-syntax-dynamic-import",
      "@babel/plugin-syntax-import-meta",
      "@babel/plugin-proposal-class-properties",
      "@babel/plugin-proposal-json-strings",
      [
          "@babel/plugin-proposal-decorators",
          {
              "legacy": true
          }
      ],
      "@babel/plugin-proposal-function-sent",
      "@babel/plugin-proposal-export-namespace-from",
      "@babel/plugin-proposal-numeric-separator",
      "@babel/plugin-proposal-throw-expressions",
      "@babel/plugin-proposal-object-rest-spread",
      "@babel/plugin-transform-object-assign"
  ]
  </code></pre>
  
  <p>}</p>
  
  <p>What am I doing wrong?</p>