Skip to content

Commit

Permalink
fix: Return inapplicable results (dequelabs#473).
Browse files Browse the repository at this point in the history
  • Loading branch information
robdodson committed Dec 11, 2017
1 parent 28fe4d6 commit b28aef3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/core/utils/aggregateRule.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ axe.utils.aggregateRule = function (subResults) {
});

// Aggregate the result
let resultList = subResults.map((node) => node.result);
ruleResult.result = axe.utils.aggregate(axe.constants.results, resultList, ruleResult.result);
// This step can be skipped if there were no nodes passed in.
// In that case, the result is 'inapplicable' and already marked as such.
if (subResults && subResults.length) {
let resultList = subResults.map((node) => node.result);
ruleResult.result = axe.utils.aggregate(axe.constants.results, resultList, ruleResult.result);
}

// Create an array for each type
axe.constants.resultGroups
Expand Down Expand Up @@ -54,4 +58,4 @@ axe.utils.aggregateRule = function (subResults) {
return ruleResult;
};

}());
}());

0 comments on commit b28aef3

Please sign in to comment.