testaro 14.2.4 → 14.2.5

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/dirWatch.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  dirWatch.js
3
- Module for launching a one-time directory watch.
3
+ Module for launching a repeated one-time directory watch.
4
4
  */
5
5
 
6
6
  // ########## IMPORTS
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testaro",
3
- "version": "14.2.4",
3
+ "version": "14.2.5",
4
4
  "description": "Automation of accessibility testing",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/standardize.js CHANGED
@@ -312,12 +312,14 @@ const convert = (testName, result, standardResult) => {
312
312
  }
313
313
  // testaro
314
314
  else if (testName === 'testaro') {
315
- const rules = Object.keys(result.rules);
315
+ const rules = result.rules ? Object.keys(result.rules) : [];
316
316
  standardResult.totals = [0, 0, 0, 0];
317
317
  rules.forEach(rule => {
318
318
  const ruleResult = result.rules[rule];
319
319
  standardResult.totals.forEach((total, index) => {
320
- standardResult.totals[index] += ruleResult.totals[index] || 0;
320
+ standardResult.totals[index] += ruleResult && ruleResult.totals
321
+ ? ruleResult.totals[index] || 0
322
+ : 0;
321
323
  });
322
324
  standardResult.instances.push(... ruleResult.standardInstances);
323
325
  });
@@ -349,5 +351,10 @@ const convert = (testName, result, standardResult) => {
349
351
  exports.standardize = act => {
350
352
  const {which} = act;
351
353
  const {result, standardResult} = act;
352
- convert(which, result, standardResult);
354
+ if (which && result && standardResult) {
355
+ convert(which, result, standardResult);
356
+ }
357
+ else {
358
+ console.log('ERROR: Result of incomplete act cannot be standardized');
359
+ }
353
360
  };