testilo 9.0.0 → 9.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/README.md CHANGED
@@ -343,7 +343,7 @@ node call score sp25a 75
343
343
  ```
344
344
 
345
345
  When a user invokes `score` in this example, the `call` module:
346
- - gets the scoring module `sp25a` from its JSON file `sp25a.json` in the `process.env.SCOREPROCDIR` directory
346
+ - gets the scoring module `sp25a` from its JSON file `sp25a.json` in the `score` subdirectory of the `process.env.FUNCTIONDIR` directory
347
347
  - gets the reports from the r`raw` subdirectory of the `process.env.REPORTDIR` directory
348
348
  - writes the scored reports to the `scored` subdirectory of the `process.env.REPORTDIR` directory
349
349
 
package/call.js CHANGED
@@ -75,7 +75,7 @@ const getReports = async (type, selector = '') => {
75
75
  // Fulfills a scoring request.
76
76
  const callScore = async (scorerID, selector = '') => {
77
77
  // Get the raw reports to be scored.
78
- const reports = getReports('raw', selector);
78
+ const reports = await getReports('raw', selector);
79
79
  // If any exist:
80
80
  if (reports.length) {
81
81
  // Get the scorer.
package/merge.js CHANGED
@@ -15,6 +15,7 @@ require('dotenv').config();
15
15
  // ########## CONSTANTS
16
16
 
17
17
  const stdRequester = process.env.REQUESTER;
18
+ // Tests that alter the page.
18
19
  const contaminantNames = new Set([
19
20
  'axe',
20
21
  'continuum',
@@ -28,6 +29,10 @@ const contaminantNames = new Set([
28
29
  'textNodes',
29
30
  'wave'
30
31
  ]);
32
+ // Tests that are immune to page alteration.
33
+ const immuneNames = new Set([
34
+ 'tenon'
35
+ ]);
31
36
 
32
37
  // ########## FUNCTIONS
33
38
 
@@ -61,12 +66,13 @@ exports.merge = (script, batch, requester, isolate = false) => {
61
66
  protoJob.timeStamp = timeStamp;
62
67
  // If isolation was requested:
63
68
  if (isolate) {
64
- // Append a copy of the previous placeholder to each eligible contaminating test in the script.
69
+ // Perform it.
65
70
  let {acts} = protoJob;
66
71
  let lastPlaceholder = {};
67
72
  for (const actIndexString in acts) {
68
73
  const actIndex = Number.parseInt(actIndexString);
69
74
  const act = acts[actIndex];
75
+ const nextAct = acts[actIndex + 1];
70
76
  if (act.type === 'placeholder') {
71
77
  lastPlaceholder = act;
72
78
  }
@@ -74,7 +80,8 @@ exports.merge = (script, batch, requester, isolate = false) => {
74
80
  act.type === 'test'
75
81
  && contaminantNames.has(act.which)
76
82
  && actIndex < acts.length - 1
77
- && acts[actIndex + 1].type !== 'placeholder'
83
+ && nextAct.type !== 'placeholder'
84
+ && (nextAct.type !== 'test' || ! immuneNames.has(nextAct.which))
78
85
  ) {
79
86
  acts[actIndex] = JSON.parse(JSON.stringify([act, lastPlaceholder]));
80
87
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testilo",
3
- "version": "9.0.0",
3
+ "version": "9.0.2",
4
4
  "description": "Client that scores and digests Testaro reports",
5
5
  "main": "aim.js",
6
6
  "scripts": {