From 028ae51e3d86fce26a1843b54fe252300cef4315 Mon Sep 17 00:00:00 2001 From: Wilco Fiers Date: Wed, 21 Feb 2018 15:04:44 +0100 Subject: [PATCH] feat: Update QUnit example --- doc/examples/qunit/package.json | 10 +++++----- doc/examples/qunit/test/a11y.js | 20 ++++++++++++-------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/doc/examples/qunit/package.json b/doc/examples/qunit/package.json index 9c79783198..c8688eecb1 100644 --- a/doc/examples/qunit/package.json +++ b/doc/examples/qunit/package.json @@ -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" } } diff --git a/doc/examples/qunit/test/a11y.js b/doc/examples/qunit/test/a11y.js index 53020f3f80..b36d6fbb13 100644 --- a/doc/examples/qunit/test/a11y.js +++ b/doc/examples/qunit/test/a11y.js @@ -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(); }); });