title: Jest: Error: Your test suite must contain at least one test
body: <p>I am implementing jest to test my React app and have set up a simple test on a utility function I have, but I am getting the error:</p>
  
  <blockquote>
    <p>Error: Your test suite must contain at least one test.</p>
  </blockquote>
  
  <p>Have checked my implementation, and I think all is correct - could someone take a look got me?</p>
  
  <p>The file structure for the test and the function is as follows</p>
  
  <pre><code>- __tests__
    -- sumObjectValues-test.js
  - utils
    -- sumObjectValues.js
  </code></pre>
  
  <p><code>sumObjectValues.js</code> is as follows:</p>
  
  <pre class="lang-js prettyprint-override"><code>const sumObjectValues = (obj, identifier) =&gt; {
      return obj
          .map((el) =&gt; { return el[identifier]; })
          .reduce((prev, next) =&gt; { return prev += next; }, 0);
  }
  
  export default sumObjectValues;
  </code></pre>
  
  <p>And <code>sumObjectValues-test.js</code>:</p>
  
  <pre class="lang-js prettyprint-override"><code>   const obj = [
      {
          "id": 0,
          "item": "Tesla Model S",
          "amount": 85000
      },
      {
          "id": 1,
          "item": "iPhone 6S",
          "amount": 600
      },
      {
          "id": 2,
          "item": "MacBook Pro",
          "amount": 1700
      }
  ];
  
  const identifier = "amount";
  
  
  jest.unmock('../client/utils/sumObjectValues'); // unmock to use the actual implementation of `sumObjectValues`
  
  describe('sumObjectValues', () =&gt; {
      if('takes an array of objects, each with amount values, &amp; sums the values', () =&gt; {
          const sumObjectValues = require('../client/utils/sumObjectValues');
          expect(sumObjectValues(obj, identifier)).toBe(87300);
      });
  });
  </code></pre>
  
  <p>Then I have <code>"test": "jest"</code> in my package.json scripts, but get the following error:</p>
  
  <pre>
  FAIL  __tests__/sumObjectValues-test.js (0s) ● Runtime Error
    - Error: Your test suite must contain at least one test.
         at onTestResult (node_modules/jest-cli/build/TestRunner.js:143:18) 1 test suite
  failed, 0 tests passed (0 total in 1 test suite, run time 13.17s) npm
  ERR! Test failed.  See above for more details.
  </pre>
  
  <p>Thanks all :)</p>
  
  <p><strong>N.B.</strong>: Was a typo in the <code>it</code>, but after fixing I am getting a new error:</p>
  
  <pre>
  FAIL __tests__/sumObjectValues-test.js (321.763s) ● sumObjectValues ›
  it takes an array of objects, each with amount values, & sums the
  values - TypeError: sumObjectValues is not a function at
  Object. (__tests__/sumObjectValues-test.js:27:10) 1 test
  failed, 0 tests passed (1 total in 1 test suite, run time 344.008s)
  npm ERR! Test failed. See above for more details.
  </pre>