Of course that in order to be able to write unit tests for your code, you will need to follow some design guidelines, but that is part of another post. Let’s suppose you followed that guidelines and now you want to write some test, these are the steps you should follow to run your tests:
- Download qunit.js
- Download qunit.css
- Create a html page referencing the 3 previous files
With these 4 steps you are almost done, open the html file and you will have your tests executed.
Here you can download a running example.