<!-- browserified version of quickcheck -->
    <script src="http://jjh.fi/~jani/qc-b.js"></script>
    <script src="https://cdn.rawgit.com/shouldjs/should.js/master/should.js"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mocha/3.1.0/mocha.min.css">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/3.1.0/mocha.js"></script>

    <div id="mocha"></div>
 
  
function squareArea(width, height) {
  return width * height;
}

mocha.setup('bdd');

describe('squareArea', function() {
  it('should calculate correct result for any given width and height', function() {
    function areaIsMultiple(width, height) {
      return squareArea(width, height) === width * height;
    }
    
    var result = qc.forAll(areaIsMultiple, qc.arbDouble, qc.arbDouble);
    should(result).be.true();    
  });
})

mocha.run();

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.