title: JavaScript, mocha test for random numbers
body: <p>I use the following code which return array of random numbers 
  my question is how should I unit test it with mocha and chai since the issue here that is provide in every run random numbers...</p>
  
  <pre><code>var randomArray = function(start, end) {
    var range = [];
    var resetRange = function() {
      for (let i = start; i &lt; end; i++) {
        range.push(i);
      }
      shuffle(range);
    };
  
    return function(n) {
      if (range.length === 0) {
        resetRange();
      }
      return range.splice(0, n);
    };
  };
  
  
  var arr = randomArray(10,20);
  </code></pre>
  
  <p><code>arr(10)</code> will provide for example</p>
  
  <pre><code>[15, 16, 14, 17, 11, 19, 18, 10, 12, 13]
  </code></pre>
  
  <p><code>arr(3)</code> will provide for example</p>
  
  <pre><code>[18, 15, 10]
  </code></pre>