title: How to test async code with mocha using await
body: <p>How do I test async code with mocha? I wanna use multiple <code>await</code> inside mocha </p>
  
  <pre class="lang-js prettyprint-override"><code>var assert = require('assert');
  
  async function callAsync1() {
    // async stuff
  }
  
  async function callAsync2() {
    return true;
  }
  
  describe('test', function () {
    it('should resolve', async (done) =&gt; {
        await callAsync1();
        let res = await callAsync2();
        assert.equal(res, true);
        done();
        });
  });
  </code></pre>
  
  <p>This produces error below:</p>
  
  <pre><code>  1) test
         should resolve:
       Error: Resolution method is overspecified. Specify a callback *or* return a Promise; not both.
        at Context.it (test.js:8:4)
  </code></pre>
  
  <p>If I remove done() I get:</p>
  
  <pre><code>  1) test
         should resolve:
       Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/tmp/test/test.js)
  </code></pre>