Auto-generating JavaScript Unit Tests

Unit tests are like apple pie, or so we’re told. There are several good unit test frameworks available for JavaScript though they require varying degrees of time and motivation on the part of the developer. In the meantime here’s a lightweight utility that will create a set of rudimentary tests with little more than a click of a button:

tester.testAll(adhocDesigner, {path:'adHocDesigner', debug: true});

Math.max = tester.test(Math.max, {
    customTestBefore: tester.argumentsCountTest);
Math.max(1)

Continue reading