testaro 62.0.0 → 62.0.2

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": "62.0.0",
3
+ "version": "62.0.2",
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/procs/nu.js CHANGED
@@ -76,12 +76,12 @@ exports.curate = (data, nuData, rules) => {
76
76
  return false;
77
77
  }
78
78
  }));
79
+ // Remove messages reporting duplicate blank IDs.
80
+ const badMessages = new Set(['Duplicate ID .', 'The first occurrence of ID was here.']);
81
+ result.messages = result.messages.filter(
82
+ message => ! badMessages.has(message.message)
83
+ );
79
84
  }
80
- // Remove messages reporting duplicate blank IDs.
81
- const badMessages = new Set(['Duplicate ID .', 'The first occurrence of ID was here.']);
82
- result.messages = result.messages.filter(
83
- message => ! badMessages.has(message.message)
84
- );
85
85
  // Return the result.
86
86
  return result;
87
87
  };
@@ -702,6 +702,6 @@ exports.standardize = act => {
702
702
  convert(which, data, result, standardResult);
703
703
  }
704
704
  else {
705
- console.log('ERROR: Result of incomplete act cannot be standardized');
705
+ console.log(`ERROR: Result of incomplete ${which || 'unknown'} act cannot be standardized`);
706
706
  }
707
707
  };
package/tests/nuVnu.js CHANGED
@@ -49,27 +49,17 @@ exports.reporter = async (page, report, actIndex) => {
49
49
  }
50
50
  // If any error was thrown:
51
51
  catch (error) {
52
- let errorMessage = error.message;
53
- // If it was due to an incompatible Java version:
54
- if (errorMessage.includes('Unsupported major.minor version')) {
55
- // Revise the error message and report this.
56
- errorMessage = `Installed version of Java is incompatible. Details: ${errorMessage}`;
52
+ const errorMessage = error.message;
53
+ try {
54
+ // Parse it as JSON, i.e. a benign nuVnu result with at least 1 violation.
55
+ nuData = JSON.parse(error.message);
56
+ }
57
+ // If parsing it as JSON fails:
58
+ catch (error) {
59
+ // Report a genuine error.
57
60
  data.prevented = true;
58
61
  data.error = errorMessage;
59
62
  }
60
- // Otherwise, i.e. if it was not due to an incompatible Java version:
61
- else {
62
- try {
63
- // Treat the error message as a JSON result reporting rule violations.
64
- nuData = JSON.parse(error.message);
65
- }
66
- // But, if parsing it as JSON fails:
67
- catch (error) {
68
- // Report this.
69
- data.prevented = true;
70
- data.error = `Error getting result (${error.message.slice(0, 300)});`;
71
- }
72
- }
73
63
  }
74
64
  // Delete the temporary file.
75
65
  await fs.unlink(pagePath);