title: Babel 7 with jest fail to run redux component testing
body: <p>I've read dozens of post regarding configuration of babel 7 with jest. Despite all my attempts I'm still getting some issues in some of my test.</p>
  
  <p>For some reason, only the test testing components connected to redux store fail.</p>
  
  <p>package.json</p>
  
  <pre><code> "@babel/cli": "^7.1.2",
          "@babel/core": "^7.1.5",
          "@babel/node": "^7.0.0",
          "@babel/plugin-proposal-class-properties": "^7.1.0",
          "@babel/plugin-proposal-object-rest-spread": "^7.0.0",
          "@babel/plugin-syntax-dynamic-import": "^7.0.0",
          "@babel/plugin-transform-async-to-generator": "^7.1.0",
          "@babel/plugin-transform-object-assign": "^7.0.0",
          "@babel/plugin-transform-runtime": "^7.1.0",
          "@babel/preset-env": "^7.1.0",
          "@babel/preset-react": "^7.0.0",
          "babel-jest": "^23.6.0",
          "babel-core": "^7.0.0-bridge.0",
  </code></pre>
  
  <p>.babelrc</p>
  
  <pre><code>{
    "presets": [
      [
        "@babel/preset-env",
        {
          "targets": {
            "browsers": [
              "last 2 versions"
            ]
          },
          "debug": false
        }
      ],
      "@babel/preset-react"
    ],
    "plugins": [
      ["babel-plugin-react-css-modules", {
        "generateScopedName": "[name]__[local]___[hash:base64:5]",
        "webpackHotModuleReloading": true
      }],
      "@babel/plugin-syntax-dynamic-import",
      "@babel/plugin-transform-modules-commonjs",
      "@babel/plugin-proposal-class-properties",
      "@babel/plugin-proposal-object-rest-spread",
      "@babel/plugin-transform-runtime",
      ["react-intl", {
        "messagesDir": "./src/translations/extractedMessages"
      }]
    ]
  }
  </code></pre>
  
  <p>My Class Test</p>
  
  <pre><code>import { shallow } from 'enzyme';
  import { shallowToJson } from 'enzyme-to-json';
  import { ReduxComp } from '../kpis/ReduxComp';
  import puppeteer from 'puppeteer';
  import universal from 'jaybe-react-universal-componentv4';
  
  describe('ReduxComp in Dashboard', () =&gt; {
    it('should render the ReduxComp', () =&gt; {
      const list = [
          {
              "id": 1,
              "type": "1",
              "client_id": "CONS",
              "queue_name": "TBD",
              "dashboard": true,
              "kpi_number": 1234,
              "kpi_percentage": 0,
              "created_at": null,
              "updated_at": null
          },
          ...
      ];
      const component = shallow(&lt;ReduxComp  data={list} /&gt;);
      expect(shallowToJson(component)).toMatchSnapshot();
    });
  });
  </code></pre>
  
  <p>Redux comp</p>
  
  <pre><code>import React from "react";
  import connect from "react-redux/es/connect/connect";
  
  ...
  
  export default connect(mapStateToProps, {
      ...ReduxCompActions
  })(withRouter(ReduxComp))
  </code></pre>
  
  <p>jest.config.js</p>
  
  <pre><code>module.exports = {
      verbose: true,
      preset: "jest-puppeteer",
      moduleDirectories: ["node_modules", "src"],
      setupFiles: [
          "./test/setup.js"
      ],
      transform: {
          "\\.(js|jsx)?$": "./test/transform.js",
      },
     /* transformIgnorePatterns: [
          "/node_modules/(?!(react-redux|@babel)).+\\.js$"
      ],*/
  }
  </code></pre>
  
  <p>I end up getting the following error: </p>
  
  <pre><code>This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.
  
      By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".
  
      Here's what you can do:
       • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
       • If you need a custom transformation specify a "transform" option in your config.
       • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.
  
      Details:
  
  
  
    /Users/jb/Documents/Github/****/node_modules/react-redux/es/connect/connect.js:1
      ({"Object.&lt;anonymous&gt;":function(module,exports,require,__dirname,__filename,global,jest){import
  _extends from "@babel/runtime/helpers/esm/extends";
                                                                                               ^^^^^^
  
  SyntaxError: Unexpected token import
  1 | import React from "react";
  2 | import CommonComponent from "./CommonComponent";
  &gt; 3 | import connect from "react-redux/es/connect/connect";
  </code></pre>
  
  <p>Then I tried to ignore react-redux and @babel:</p>
  
  <pre><code>transformIgnorePatterns: [
          "/node_modules/(?!(react-redux|@babel)).+\\.js$"
      ]
  </code></pre>
  
  <p>But then I got another error:</p>
  
  <pre><code>TypeError: (0 , _typeof4.default) is not a function
        91 | };
        92 | 
      &gt; 93 | export default connect(mapStateToProps, {
  </code></pre>