testaro 64.1.0 → 64.2.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/tests/testaro.js +12 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testaro",
3
- "version": "64.1.0",
3
+ "version": "64.2.0",
4
4
  "description": "Run 1000 web accessibility tests from 11 tools and get a standardized report",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/tests/testaro.js CHANGED
@@ -443,7 +443,8 @@ exports.reporter = async (page, report, actIndex) => {
443
443
  rulePreventions: [],
444
444
  rulePreventionMessages: {},
445
445
  rulesInvalid: [],
446
- ruleTestTimes: {}
446
+ ruleTestTimes: {},
447
+ ruleData: {}
447
448
  };
448
449
  const result = {};
449
450
  const allRuleIDs = allRules.map(rule => rule.id);
@@ -554,11 +555,11 @@ exports.reporter = async (page, report, actIndex) => {
554
555
  });
555
556
  // Perform the test, subject to the time limit.
556
557
  const ruleReport = require(`../testaro/${ruleID}`).reporter(... ruleArgs);
557
- // Get the test result or a timeout result.
558
+ // Get the rule report or a timeout report.
558
559
  const ruleOrTimeoutReport = await Promise.race([timer, ruleReport]);
559
560
  // If the test was completed:
560
561
  if (! ruleOrTimeoutReport.timedOut) {
561
- // Add data from the test to the result.
562
+ // Add data from the rule report to the tool result.
562
563
  const endTime = Date.now();
563
564
  testTimes.push([ruleID, Math.round((endTime - startTime) / 1000)]);
564
565
  Object.keys(ruleOrTimeoutReport).forEach(key => {
@@ -566,7 +567,7 @@ exports.reporter = async (page, report, actIndex) => {
566
567
  });
567
568
  // If the test was prevented:
568
569
  if (ruleResult.data?.prevented && ruleResult.data.error) {
569
- // Add this to the result.
570
+ // Add this to the tool result.
570
571
  data.rulePreventions.push(ruleID);
571
572
  data.rulePreventionMessages[ruleID] = ruleResult.data.error;
572
573
  }
@@ -575,6 +576,13 @@ exports.reporter = async (page, report, actIndex) => {
575
576
  // Round them.
576
577
  ruleResult.totals = ruleResult.totals.map(total => Math.round(total));
577
578
  }
579
+ const ruleDataMiscKeys = Object.keys(ruleResult.data).filter(key => ! ['prevented', 'error'].includes(key));
580
+ // For any other property of the rule report data object:
581
+ ruleDataMiscKeys.forEach(key => {
582
+ data.ruleData[ruleID] ??= {};
583
+ // Add it to the tool result.
584
+ data.ruleData[ruleID][key] = ruleResult.data[key];
585
+ });
578
586
  // Prevent a retry of the test.
579
587
  testSuccess = true;
580
588
  // If testing is to stop after a failure and the page failed the test: