testaro 14.5.1 → 14.6.1

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
@@ -271,6 +271,8 @@ standardResult: {
271
271
 
272
272
  If a tool has the option to be used without itemization and is being so used, the `instances` array may be empty.
273
273
 
274
+ The standard format is not opinionated about issue classifications. It treats an issue ID from any tool as an identifier of what that tool considers to be the issue. Useful reporting from multi-tool testing still requires issue classification. If tool `A` identifies an issue as `alt-incomplete` and tool `B` identifies an issue as `image_alt_meaningless`, Testaro does not decide whether those are really the same issue or different issues. That decision belongs to whoever consumes Testaro reports. The standardization of tool reports by Testaro eliminates some of the drudgery in issue classification, but not any of the judgment required for issue classification.
275
+
274
276
  ### Acts
275
277
 
276
278
  #### Introduction
@@ -532,7 +534,7 @@ The `ibm` tool is one of two tools (`testaro` is the other) with a `withItems` p
532
534
 
533
535
  The `nuVal` tool performs the tests of the Nu Html Checker.
534
536
 
535
- Its `rules` argument is **not** an array of rule IDs, but instead is an array of rule _specifications_. A rule specification for `nuVal` is a string with the format `type:substring`, where `type` is replaced with a message type (namely `info` or `error`) and `substring` is replaced with any substring of a message. This `rules` format arises from the fact that `nuVal` generates customized messages and does not accompany them with rule identifiers. Thus, by choosing a type and a substring, you are deciding that any message of that type that includes that substring will be deemed a `nuVal` rule.
537
+ Its `rules` argument is **not** an array of rule IDs, but instead is an array of rule _specifications_. A rule specification for `nuVal` is a string with the format `=ruleID` or `~ruleID`. The `=` prefix indicates that the rule ID is invariable. The `~` prefix indicates that the rule ID is variable, in which case the `ruleID` part of the specification is a matching regular expression, rather than the exact text of a message. This `rules` format arises from the fact that `nuVal` generates customized messages and does not accompany them with rule identifiers.
536
538
 
537
539
  ###### QualWeb
538
540
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testaro",
3
- "version": "14.5.1",
3
+ "version": "14.6.1",
4
4
  "description": "Automation of accessibility testing",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/tests/nuVal.js CHANGED
@@ -60,17 +60,24 @@ exports.reporter = async (page, options) => {
60
60
  fetchOptions.body = page[1];
61
61
  const nuResult = await fetch(nuURL, fetchOptions);
62
62
  const nuData = await nuResult.json();
63
- const nuDataClean = JSON.parse(JSON.stringify(nuData).replace(/[\u{fffd}“”]/ug, ''));
64
63
  // Delete left and right quotation marks and their erratic invalid replacements.
64
+ const nuDataClean = JSON.parse(JSON.stringify(nuData).replace(/[\u{fffd}“”]/ug, ''));
65
65
  data[page[0]] = nuDataClean;
66
- // If there is a report and restrictions on the report messages were specified:
66
+ // If there is a report and rules were specified:
67
67
  if (! data[page[0]].error && rules && Array.isArray(rules) && rules.length) {
68
68
  // Remove all messages except those specified.
69
- const ruleSpecs = rules.map(ruleSpec => ruleSpec.split(':', 2));
70
- data[page[0]].messages = data[page[0]].messages.filter(message => ruleSpecs.some(
71
- ruleSpec => message.type === ruleSpec[0]
72
- && message.message.includes(ruleSpec[1])
73
- ));
69
+ data[page[0]].messages = data[page[0]].messages.filter(message => rules.some(rule => {
70
+ if (rule[0] === '=') {
71
+ return message.message === rule.slice(1);
72
+ }
73
+ else if (rule[0] === '~') {
74
+ return new RegExp(rule.slice(1)).test(message.message);
75
+ }
76
+ else {
77
+ console.log(`ERROR: Invalid nuVal rule ${rule}`);
78
+ return false;
79
+ }
80
+ }));
74
81
  }
75
82
  }
76
83
  catch (error) {