title: Running ES2016 unit tests with Jest in BitBucket's Pipelines
body: <p>I have a webapp I created using <a href="https://github.com/facebookincubator/create-react-app" rel="nofollow noreferrer">create-react-app</a>. I've already ejected the project. Now I'm trying to configure Jest, Enzyme and all the rest to play well with BitBucket's Pipelines, to be able to run it in <code>bitbucket-pipelines.yml</code> config.</p>
  
  <p>Locally, the tests are executed fine (using <code>npm test</code>), but when running the code on BitBucket, I'm getting the following error:</p>
  
  <pre><code>npm test
  &gt; sicj@0.1.0 test /opt/atlassian/pipelines/agent/build
  &gt; node scripts/test.js --env=jsdom
   FAIL  src/App.test.js
    ● Test suite failed to run
      Cannot find module 'enzyme' from 'App.test.js'
  
        at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:144:17)
        at Object.&lt;anonymous&gt; (src/App.test.js:3:41)
  Test Suites: 1 failed, 1 total
  Tests:       0 total
  Snapshots:   0 total
  Time:        1.323s
  Ran all test suites.
  npm ERR! Test failed.  See above for more details.
  </code></pre>
  
  <p>So it's just failing to find <code>enzyme</code> module. To check if the module is installed correctly, I run <code>ls node_modules</code> and then <code>ls node_modules/enzyme</code>. Here is the result:</p>
  
  <pre><code>+ ls node_modules/enzyme
  CHANGELOG.md     ReactWrapper.js            karma.conf.js  src
  CONTRIBUTING.md  ShallowWrapper.js          mount.js       test
  INTHEWILD.md     book.json                  node_modules       withDom.js
  LICENSE.md       docs                       package.json
  MAINTAINERS      example-test.sh            render.js
  README.md        install-relevant-react.sh  shallow.js
  </code></pre>
  
  <p>Well, it looks good to me.</p>
  
  <p>What am I doing wrong? I'm just starting with React and generally with front-end development. I don't get what's the difference between running it locally (on my desktop) and on BitBucket.</p>
  
  <p>I've already tried:</p>
  
  <ul>
  <li>removing <code>node_modules</code> folder and rerunning <code>npm install</code></li>
  <li>applying the pointer in <a href="https://stackoverflow.com/questions/35761861/referenceerror-on-enzyme-import">ReferenceError on enzyme import</a></li>
  </ul>
  
  <p>but no change in behavior.</p>