title: Running a repeated mocha test for a function
body: <p>I am new <code>mocha</code> and I need to run one test <code>100</code> times. In the following code, a function <code>regexTest</code> is tested for <code>true</code>.</p>
  
  <pre><code>var assert = require('assert');
  
  describe('regexTest',function() {
      it('should return true if the string starts with a number',function() {
          var i = 1;
          while(i++ &lt;= 100) {
              assert.equal(true,regexTest(Math.random().toString(36).substring(7)));
          }
      });
  })
  
  function regexTest(randStr) {
      let match = randStr.match(/^\d+/);
      if(match &amp;&amp; match.length &gt; 0) {
          return true;
      }else{
          return false;
      }
  }
  </code></pre>
  
  <p>I am not sure if this is the correct way to run a repeated test, inside a while loop. Also, I doubt the results because no matter what, it always returns passed for a single test.</p>
  
  <p>What could be a better approach here?</p>