title: TypeError: environment.setup is not a function in React Testing
body: <p>I was trying to implement the example shown in Jest website: <a href="http://facebook.github.io/jest/docs/en/getting-started.html" rel="noreferrer">Getting started with Jest</a>. </p>
  
  <p>While running <code>npm test</code> on I was getting the following error:</p>
  
  <pre><code>FAIL  src/sum.test.js
    ● Test suite failed to run
  
      TypeError: environment.setup is not a function
  
        at node_modules/jest-runner/build/run_test.js:112:23
  </code></pre>
  
  <p><code>sum.js</code>:</p>
  
  <pre><code>function sum(a, b){
    return a+b;
  }
  module.exports = sum;
  </code></pre>
  
  <p><code>sum.test.js</code>:</p>
  
  <pre><code>const sum = require('./sum');
  
  test('adding sum function', () =&gt; {
    expect(sum(234,4)).toBe(238);
  })
  </code></pre>
  
  <p><code>sum.js</code> and <code>sum.test.js</code> are an exact copy of the example shown in <a href="http://facebook.github.io/jest/docs/en/getting-started.html" rel="noreferrer">Getting started with Jest</a>.</p>
  
  <p><code>package.json</code>:</p>
  
  <pre><code>{
    "name": "jest-demo-test",
    "version": "0.1.0",
    "private": true,
    "dependencies": {
      "react": "^16.2.0",
      "react-dom": "^16.2.0",
      "react-scripts": "1.0.17"
    },
    "scripts": {
      "start": "react-scripts start",
      "build": "react-scripts build",
      "test": "jest",
      "eject": "react-scripts eject"
    },
    "devDependencies": {
      "jest": "^22.0.4"
    }
  }
  </code></pre>
  
  <p>So, how can I get rid of <code>TypeError: environment.setup is not a function</code> error?</p>