Skip to content

Commit

Permalink
feat: Update QUnit example
Browse files Browse the repository at this point in the history
  • Loading branch information
WilcoFiers committed Feb 26, 2018
1 parent 641b5e6 commit 028ae51
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
10 changes: 5 additions & 5 deletions doc/examples/qunit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
},
"dependencies": {},
"scripts": {
"build": "grunt"
"test": "grunt qunit"
},
"devDependencies": {
"axe-core": "~1.0.1",
"grunt": "~0.4.4",
"grunt-contrib-qunit": "~0.4.0",
"qunitjs": "~1.14.0"
"axe-core": "^2.6.1",
"grunt": "~1.0.2",
"grunt-contrib-qunit": "~2.0.0",
"qunitjs": "~2.4.1"
}
}
20 changes: 12 additions & 8 deletions doc/examples/qunit/test/a11y.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
/* global module, asyncTest, expect, start, document, axe */
/* global QUnit, document, axe */

module('axe');
QUnit.module('axe');

asyncTest('should report that good HTML is good', function (assert) {
QUnit.test('should report that good HTML is good', function (assert) {
var n = document.getElementById('working');
expect(1);
assert.expect(2);

var done = assert.async();
axe.run(n, function (err, result) {
assert.equal(err, null);
assert.equal(result.violations.length, 0);
start();
done();
});
});

asyncTest('should report that bad HTML is bad', function (assert) {
QUnit.test('should report that bad HTML is bad', function (assert) {
var n = document.getElementById('broken');
expect(1);
assert.expect(2);

var done = assert.async();
axe.run(n, function (err, result) {
assert.equal(err, null);
assert.equal(result.violations.length, 1);
start();
done();
});
});

0 comments on commit 028ae51

Please sign in to comment.