3. What Is QUnit?
QUnit is the testing suite for jQuery scripts and
plugins.
It doesn't need jQuery scripts to test other javascript
codes.
4. Creating Tests with QUnit
Download the QUnit script (and the optional QUnit
css)
Create test script to run against target external
javascript
Create html file to display test results
5. Sample Function to Test
function addNumbers(num1, num2) {
if (isNaN(num1)) {
return "First parameter is NaN";
} else if (isNaN(num2)) {
return "Second parameter is NaN";
} else {
return num1 + num2;
}
}