June 2013
Beginner
444 pages
9h 45m
English
QUnit provides two levels of test grouping named after their respective function calls: module() and test(). The
module is like a general category under which the tests will be run; the test is actually a set of tests; the function takes a callback in which all of that test's specific unit tests are run. We'll group our tests by the chapter topic, placing the code in our test/test.js file:
module('Selecting');
test('Child Selector', function() {
ok(true, 'Placeholder is entered');
});
test('Attribute Selectors', function() {
ok(true, 'Placeholder is entered');
});
module('Ajax');Listing B.1
It's not necessary to set up the file with this test structure, but it's good to have some overall structure in mind. In addition to the ...