Slide 92
Slide 92 text
QUnit Example
//For below, remember to include markup for your QUnit test output template along
with jquery, qunit.js and qunit.css as these are required.
$(function(){
test("A very basic test", function() {
ok( true, "this test passes fine" );
var value = "hello world";
equals( "hello world", value, "We expect value to be hello world" );
});
module("Module A");
test("first test within a module", function() {
ok( true, "all pass" );
});
module("Module B");
test("Another test", function() {
expect(2);
equals( true, false, "failing test" );
equals( true, true, "passing test" );
});
});
Friday, 3 June 2011