- Integration tests are for how users interact with an app, and unit tests are for small modules of code
- QUnit is a framework for writing JavaScript unit tests
Simple Implementation
Page (tests.php)
...
<link rel="stylesheet" href="css/qunit-1.11.0.css">
...
<div id="qunit"></div>
<div id="qunit-fixture"></div>
...
<script type="text/javascript" src="js/qunit-1.11.0.js"></script>
<script type="text/javascript" src="js/tests.js"></script>
tests.js
test("hello test", function(){
ok( 1 == "1", "Passed!" );
});
Resources