testaro 74.1.1 → 74.1.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testaro",
3
- "version": "74.1.1",
3
+ "version": "74.1.3",
4
4
  "description": "Run 1300 web accessibility tests from 10 tools and get a standardized report",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/procs/nu.js CHANGED
@@ -58,6 +58,14 @@ exports.curate = async (data, nuData, rules) => {
58
58
  const nuDataClean = JSON.parse(nuDataValid);
59
59
  result = nuDataClean;
60
60
  }
61
+ // Guarantee result.messages is always an iterable. The W3C API returns
62
+ // {messages: [...]} on success, but on HTTP errors (e.g. 502) or fetch
63
+ // failures nuVal leaves nuData={}, so result becomes {}
64
+ // and `result.messages.filter(...)` below throws
65
+ // "Cannot read properties of undefined (reading 'filter')".
66
+ if (result && ! Array.isArray(result.messages)) {
67
+ result.messages = [];
68
+ }
61
69
  // If there is a result and rules were specified:
62
70
  if (result && rules && Array.isArray(rules) && rules.length) {
63
71
  // Remove all messages except those specified.
package/tests/nuVal.js CHANGED
@@ -11,7 +11,7 @@
11
11
  /*
12
12
  nuVal
13
13
  This tool subjects a page and its source to the Nu Html Checker, thereby testing scripted content found only in the loaded page and erroneous content before the browser corrects it. The API erratically replaces left and right double quotation marks with invalid UTF-8, which appears as 2 or 3 successive instances of the replacement character (U+fffd). Therefore, this test removes all such quotation marks and the replacement character. That causes 'Bad value “” for' to become 'Bad value for'. Since the corruption of quotation marks is erratic, no better solution is known.
14
- This tool is the API version of the Nu Html Checker. It is an alternative to the nuVnu tool, which uses the same validator as an installed dependency. Each tool has advantages and disadvantages. The main advantage of nuVal is that it does not require the Testaro host to provide a Java virtual machine. The main disadvantage of nuVal is that it returns 502 status errors when the content being uploaded is larger than about 80,000 bytes. The main advantage of the nuVnu tool is that it can evaluate pages larger than about 80,000 bytes and pages reachable from the host that Testaro runs on even if not reachable from the public Internet.
14
+ This tool is the API version of the Nu Html Checker. It is an alternative to the nuVnu tool, which uses the same validator as an installed dependency. Each tool has advantages and disadvantages. The main advantage of nuVal is that it does not require the Testaro host to provide a Java virtual machine. The main advantage of the nuVnu tool is that it can evaluate pages reachable from the host that Testaro runs on even if not reachable from the public Internet.
15
15
  */
16
16
 
17
17
  // IMPORTS
package/tests/testaro.js CHANGED
@@ -504,7 +504,14 @@ exports.reporter = async (page, report, actIndex) => {
504
504
  && ['y', 'n'].includes(ruleSpec[0])
505
505
  && ruleSpec.slice(1).every(ruleID => allRuleIDs.includes(ruleID))
506
506
  ) {
507
- // Get the rules to be (y) or not to be (n) tested for and their execution order.
507
+ // Get the rules to be tested for and their execution order.
508
+ // 'y' = include-list: run exactly the rules in ruleSpec.slice(1).
509
+ // 'n' = exclude-list: run all defaultOn rules EXCEPT those in
510
+ // ruleSpec.slice(1). (The prior implementation was a no-op:
511
+ // it checked against `allRuleIDs` — which is every rule's id —
512
+ // so the predicate was never true, and it returned rule
513
+ // objects rather than IDs, which then never matched the
514
+ // string comparison on the next line.)
508
515
  const excludeIDs = ruleSpec.slice(1);
509
516
  const jobRuleIDs = ruleSpec[0] === 'y'
510
517
  ? excludeIDs