title: How to execute mocha test suite for specific amount of time
body: <p>I have a requirement like have to execute the below test suite for specific amount time.</p>
  
  <pre><code>  describe("sample test script", function(){
  
        it("sample test case", function(done) {
             //---test case statements
             done();
        });    
    });
  </code></pre>
  
  <p>I have tried using While loop as below code. But the thing is iterations are happening continuously without completion of <code>describe</code> statement. I want to wait for the iteration till <code>describe</code> block execution and continue the loop. How will do I this thing </p>
  
  <p>var testCaseTimeDuration= new Date(new Date().getTime() + (config.testCaseExecutionTime * 60000));</p>
  
  <pre><code>    while(testCaseDuration &gt; new Date()) { 
  
       describe("sample test script", function(){
  
                it("sample test case", function(done) {
                     //---test case statements
                     done();
                });    
            });
      }
  </code></pre>