QUnit provides two levels of test grouping named after their respective function calls: QUnit.module() and QUnit.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 and place the code in our test/test.js file:
QUnit.module('Selecting');
QUnit.test('Child Selector', (assert) => {
assert.expect(0);
});
QUnit.test('Attribute Selectors', (assert) => {
assert.expect(0);
});
QUnit.module('Ajax');
Listing A.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 QUnit.module() and QUnit.test() grouping, we have to tell the test how many assertions to expect. Since...