testaro 33.1.3 → 34.0.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 CHANGED
@@ -424,7 +424,7 @@ When you include a `rules` property, you limit the tests of the tool that are pe
424
424
 
425
425
  The `nuVal`, `qualWeb`, and `testaro` tools require specific formats for the `rules` property. Those formats are described below in the sections about those tools.
426
426
 
427
- The `aslint` and `ed11y` tools do not yet allow rule specification.
427
+ The `ed11y` tool does not yet allow rule specification.
428
428
 
429
429
  ###### Examples
430
430
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testaro",
3
- "version": "33.1.3",
3
+ "version": "34.0.0",
4
4
  "description": "Run 1000 web accessibility tests from 10 tools and get a standardized report",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/tests/aslint.js CHANGED
@@ -43,7 +43,7 @@ exports.reporter = async (page, options) => {
43
43
  `${__dirname}/../node_modules/aslint-testaro/aslint.bundle.js`, 'utf8'
44
44
  );
45
45
  // Get the nonce, if any.
46
- const {report} = options;
46
+ const {act, report} = options;
47
47
  const {jobData} = report;
48
48
  const scriptNonce = jobData && jobData.lastScriptNonce;
49
49
  // Inject the ASLint bundle and runner into the page.
@@ -94,10 +94,16 @@ exports.reporter = async (page, options) => {
94
94
  const actReport = await reportLoc.textContent();
95
95
  // Populate the act report.
96
96
  result = JSON.parse(actReport);
97
- // Delete irrelevant properties from the tool report details.
97
+ // If any rules were reported violated:
98
98
  if (result.rules) {
99
+ // For each such rule:
99
100
  Object.keys(result.rules).forEach(ruleID => {
100
- if (['passed', 'skipped'].includes(result.rules[ruleID].status.type)) {
101
+ // If the rule was passed or skipped or rules to be tested were specified and exclude it:
102
+ if (
103
+ ['passed', 'skipped'].includes(result.rules[ruleID].status.type)
104
+ || act.rules && ! act.rules.includes(ruleID)
105
+ ) {
106
+ // Delete the rule report.
101
107
  delete result.rules[ruleID];
102
108
  }
103
109
  });