May 2017
Intermediate to advanced
448 pages
10h 10m
English
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');
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 ...
Read now
Unlock full access