Jest fails unless use --no-cache, even with babel-jest and .babelrc
<p>This test passes if run Jest with <code>--no-cache</code>, but as per error msg below, I shouldn't get error with <code>babel-jest</code>, which I have.</p>

<p>See my .babelrc and package.json below, and test files.</p>

<p><strong>ERROR:</strong></p>

<pre><code>Using Jest CLI v12.1.1, jasmine2, babel-jest
 FAIL  __tests__/junk-test.js
Runtime Error
  - SyntaxError: Unexpected reserved word in file 'junk.js'.

    Make sure your preprocessor is set up correctly and ensure your 'preprocessorIgnorePatterns' configuration is correct: http://facebook.github.io/jest/docs/api.html#preprocessorignorepatterns-array-string
    If you are currently setting up Jest or modifying your preprocessor, try `jest --no-cache`.
    Preprocessor: node_modules/babel-jest/src/index.js.
    Make sure your '.babelrc' is set up correctly, for example it should include the 'es2015' preset.
    Jest tried to the execute the following preprocessed code:
    var junk = function () {
        return "thing";};

    export { junk };
</code></pre>

<p><strong>__tests__/junk-test.js</strong></p>

<pre><code>// __tests__/junk-test.js

jest.unmock('../junk.js');

import {junk} from '../junk';


describe('JUNK AwesomeProject', () =&gt; {
  it('Junk var = string', () =&gt; {
    var retVal = junk();
    expect(retVal).toEqual("thing");
  });
});
</code></pre>

<p><strong>junk.js</strong></p>

<pre><code>var junk = function(){
    return "thing";
}

export {junk};
</code></pre>

<p><strong>package.json</strong></p>

<pre><code>{
  "dependencies": {
    "babel-preset-react": "6.5.0",
    "babelify": "7.3.0",
    "react": "15.1.0",
    "react-dom": "15.1.0"
  },
  "devDependencies": {
    "babel-jest": "12.1.0",
    "babel-polyfill": "6.9.0",
    "babel-preset-es2015": "*",
    "jest-cli": "12.1.1",
    "react-addons-test-utils": "15.1.0"
  },
  "scripts": {
    "test": "jest"
  },
  "jest": {
    "verbose": true,
    "unmockedModulePathPatterns": [
      "&lt;rootDir&gt;/node_modules/react/",
      "&lt;rootDir&gt;/node_modules/react-dom/",
      "&lt;rootDir&gt;/node_modules/react-addons-test-utils/"
    ]
  }
}
</code></pre>

<p><strong>.babelrc</strong></p>

<pre><code>{
  "presets": ["es2015", "react"]
}
</code></pre>

<h2><strong>UPDATE</strong></h2>

<p>Ahh. Changing junk.js to an explicit return and now the test passes.</p>

<p>What's odd is Flow didn't catch this, maybe ESlint would, that's next on my list to try:</p>

<pre><code>var junk = function() { 
   var stuff = "thing"; 
   return stuff; 
}
</code></pre>