title: How to make mocha test wait until execution completes
body: <p>I am writing tests in nodejs using mocha framework.I have multiple it blocks in the test. I am facing problems when executing the code which does not return promises.The test report gets generated with out finishing the it block execution. How can I handle this scenario? </p>
  
  <p>For the it blocks which deal with promises, return statements is serving the need. For the it block which doesn't deal with promises,I have tried by giving done method and it doesn't help.</p>
  
  <pre><code>it('Fill in the details',  function(done) {
  homepg.name().enterValue('user1');
  homepg.group().enterValue('grp1');
  done();
  }
  </code></pre>
  
  <p>homepg is a class file which has methods name and group. Both these methods return custom webelements. These custom web elements handle promises internally.</p>
  
  <p>Expected Output: Mocha test should complete first and then test report should get generated.</p>
  
  <p>Actual Output: Test report gets generated without Mocha test being completed.</p>