Qunit:jquery's unit testing framework, but not limited to jquery (as can be seen from this tool without reference to jquery.js)
Index.html
<!--official website http://qunitjs.com/ -<!DOCTYPE HTML><HTML><Head> <MetaCharSet= "Utf-8"> <title>Qunit Example</title> <Linkrel= "stylesheet"href= "Qunit-1.16.0.css"></Head><Body> <DivID= "Qunit"></Div> <DivID= "Qunit-fixture"></Div> <Scriptsrc= "Qunit-1.16.0.js"></Script> <!--Test Framework - <Scriptsrc= "Tests.js"></Script> <!--Unit Test Module - <Scriptsrc= "Api.js"></Script> <!--The module under test -</Body></HTML>
Api.js
function sum (A, b) { return a + b;}
Tests.js
Qunit.module ("OnRead", { // initialize function() { Console.log ( "Setup"); }, // cleanup function() { Console.log ("clean"); }); // Test Cases function (assert) { console.log ("sum"); 1 = = "1", "passed!" );});
Direct execution of Index.html
JS Unit Test Framework: Qunit