title: How to use babel-preset-env with Jest
body: <p>We are in the midst of updating our API, and Henry Zhu from Babel alerted me to this preset called <code>babel-preset-env</code> to replace need for <code>babel-preset-es2015</code> and <code>babel-preset-es2018</code>.</p>
  
  <p>Now, I am encountering difficulty understanding the simplest way to handle everything.</p>
  
  <ul>
  <li>Our API uses node v8.x and async/await, native promises</li>
  <li>I want spread operator</li>
  <li>I want pipeline operator</li>
  <li>I want import/export syntax</li>
  <li>I want to support Jest</li>
  <li>I like how babel-node transpiles the API into memory</li>
  </ul>
  
  <p>This will be easier if I just show you the current position of our config:</p>
  
  <blockquote>
    <p>.babelrc</p>
  </blockquote>
  
  <pre><code> {
     "presets": [
       "env",
         {
           "targets": {
             "node": "current"
           }
         },
       "jest"
     ]
   }
  </code></pre>
  
  <blockquote>
    <p>package.json</p>
  </blockquote>
  
  <pre><code> {
     "scripts": {
       "test": "node --harmony-async-await node_modules/jest/bin/jest.js",
       "start:local": "NODE_ENV=localhost npm run babel-node -- warpcore/server.js",
       "start": "npm run babel-node -- warpcore/server.js",
       "babel-node": "babel-node --presets=es2015,stage-2"
     },
     "dependencies": {
       "babel-polyfill": "^6.23.0"
     },
     "devDependencies": {
       "babel-cli": "^6.24.1",
       "babel-core": "^6.25.0",
       "babel-eslint": "^7.2.3",
       "babel-jest": "^20.0.3",
       "babel-preset-env": "^1.6.0",
       "babel-preset-es2015": "^6.24.1",
       "babel-preset-es2018": "^1.0.0",
       "babel-preset-stage-2": "^6.24.1",
       "jest": "^20.0.4"
     },
     "jest": {
       "testURL": "http://localhost:8080",
       "testEnvironment": "node"
     }
   }
  </code></pre>
  
  <p>I am uncertain how these things need to be organized to best achieve my bullet list above.</p>
  
  <blockquote>
    <p>What changes should I make?</p>
  </blockquote>
  
  <ul>
  <li>I think the babel-node script needs to change</li>
  <li>I suspect I can remove some of these packages</li>
  <li>I suspect the <code>.babelrc</code> file isn't optimal</li>
  </ul>