testaro 28.0.3 → 28.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/procs/standardize.js +22 -3
package/README.md
CHANGED
|
@@ -285,7 +285,7 @@ This standard format reflects some judgments. For example:
|
|
|
285
285
|
- The `ordinalSeverity` property of an instance may have required interpretation. Tools may report severity, certainty, priority, or some combination of those. They may use ordinal or metric quantifications. If they quantify ordinally, their scales may have more or fewer than 4 ranks. Testaro coerces each tool’s severity, certainty, and/or priority classification into a 4-rank ordinal classification. This classification is deemed to express the most common pattern among the tools.
|
|
286
286
|
- The `tagName` property of an instance may not always be obvious, because in some cases the rule being tested for requires a relationship among more than one element (e.g., “An X element may not have a Y element as its parent”).
|
|
287
287
|
- The `ruleID` property of an instance is a matching rule if the tool issues a message but no rule identifier for each instance. The `nuVal` tool does this. In this case, Testaro is classifying the messages into rules.
|
|
288
|
-
- The `ruleID` property of an instance may reclassify tool rules. For example, if a tool rule covers multiple situations that are dissimilar
|
|
288
|
+
- The `ruleID` property of an instance may reclassify tool rules. For example, if a tool rule covers multiple situations that are dissimilar, that rule may be split into multiple rules with distinct `ruleID` properties.
|
|
289
289
|
|
|
290
290
|
You are not dependent on the judgments incorporated into the standard format, because Testaro can give you the original reports from the tools.
|
|
291
291
|
|
package/package.json
CHANGED
package/procs/standardize.js
CHANGED
|
@@ -39,6 +39,21 @@ const getIdentifiers = code => {
|
|
|
39
39
|
}
|
|
40
40
|
return [tagName, id];
|
|
41
41
|
};
|
|
42
|
+
// Specifies conversions of rule IDs of aslint based on what substrings.
|
|
43
|
+
const aslintData = {
|
|
44
|
+
'misused-required-attribute': [
|
|
45
|
+
['not needed', 'misused-required-attributeR']
|
|
46
|
+
],
|
|
47
|
+
'accessible-svg': [
|
|
48
|
+
['associated', 'accessible-svgI'],
|
|
49
|
+
['tabindex', 'accessible-svgT']
|
|
50
|
+
],
|
|
51
|
+
'audio-alternative': [
|
|
52
|
+
['track', 'audio-alternativeT'],
|
|
53
|
+
['alternative', 'audio-alternativeA'],
|
|
54
|
+
['bgsound', 'audio-alternativeB']
|
|
55
|
+
]
|
|
56
|
+
};
|
|
42
57
|
// Converts issue instances at an axe certainty level.
|
|
43
58
|
const doAxe = (result, standardResult, certainty) => {
|
|
44
59
|
if (result.details && result.details[certainty]) {
|
|
@@ -269,9 +284,6 @@ const convert = (toolName, result, standardResult) => {
|
|
|
269
284
|
if (ruleResults && ruleResults.length) {
|
|
270
285
|
ruleResults.forEach(ruleResult => {
|
|
271
286
|
const what = ruleResult.message.actual.description;
|
|
272
|
-
if (ruleID === 'misused-required-attribute' && what.includes('not needed')) {
|
|
273
|
-
ruleID = 'misused-required-attributeR';
|
|
274
|
-
}
|
|
275
287
|
const {issueType} = result.rules[ruleID];
|
|
276
288
|
const xpath = ruleResult.element && ruleResult.element.xpath || '';
|
|
277
289
|
const tagName = xpath && xpath.replace(/^.*\//, '').replace(/[^-\w].*$/, '').toUpperCase()
|
|
@@ -281,6 +293,13 @@ const convert = (toolName, result, standardResult) => {
|
|
|
281
293
|
const id = idDraft && idDraft.length > 3 && idDraft.startsWith('id=')
|
|
282
294
|
? idDraft.slice(3)
|
|
283
295
|
: '';
|
|
296
|
+
const ruleData = aslintData[ruleID];
|
|
297
|
+
if (ruleData) {
|
|
298
|
+
const changer = ruleData.find(pair => what.includes(pair[0]));
|
|
299
|
+
if (changer) {
|
|
300
|
+
ruleID = changer[1];
|
|
301
|
+
}
|
|
302
|
+
}
|
|
284
303
|
const instance = {
|
|
285
304
|
ruleID,
|
|
286
305
|
what,
|