Skip to content

Commit

Permalink
chore: Improve test runner for logging and assertion on incomplete er…
Browse files Browse the repository at this point in the history
…rors (#1058)
  • Loading branch information
jeeyyy authored and WilcoFiers committed Aug 14, 2018
1 parent 7d4b70f commit 8479108
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion test/integration/rules/runner.js
Expand Up @@ -102,11 +102,27 @@
axe.run(
fixture,
{
/**
* The debug flag helps log errors in a fairly detailed fashion,
* when tests fail in webdriver
*/
debug: true,
performanceTimer: false,
runOnly: { type: 'rule', values: [ruleId] }
},
function(err, r) {
assert.isNull(err);
// assert that there are no errors - if error exists a stack trace is logged.
var errStack = err && err.stack ? err.stack : '';
assert.isNull(err, 'Error should be null. ' + errStack);
// assert that result is defined
assert.isDefined(r, 'Results are defined.');
// assert that result has certain keys
assert.hasAnyKeys(r, ['incomplete', 'violations', 'passes']);
// assert incomplete(s) does not have error
r.incomplete.forEach(function(incomplete) {
assert.isUndefined(incomplete.error);
});
// flatten results
results = flattenResult(r);
done();
}
Expand Down

0 comments on commit 8479108

Please sign in to comment.