testilo 12.0.2 → 12.0.4

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.
Files changed (3) hide show
  1. package/README.md +43 -43
  2. package/package.json +1 -1
  3. package/script.js +5 -3
package/README.md CHANGED
@@ -189,6 +189,49 @@ The `call` module will retrieve the named target list.
189
189
  The `batch` module will convert the target list to a batch.
190
190
  The `call` module will save the batch as a JSON file in the `batches` subdirectory of the `process.env.SPECDIR` directory.
191
191
 
192
+ ### Issues to script
193
+
194
+ Testilo classifies issues. The built-in issue classifications are located in the `procs/score` directory, in files whose names begin with `tic` (for “Testilo issue classification”). You can create additional `tic` files with custom issue classifications.
195
+
196
+ If you want Testaro to test targets for particular issues, you can name those issues and use the Testilo `script` module to create a script.
197
+
198
+ #### Invocation
199
+
200
+ There are two ways to use the `script` module.
201
+
202
+ ##### By a module
203
+
204
+ A module can invoke `script` in this way:
205
+
206
+ ```javaScript
207
+ const {script} = require('testilo/script');
208
+ const scriptObj = script(scriptID, issueClasses, issueID0, issueID1, …);
209
+ ```
210
+
211
+ This invocation references `scriptID`, `issueClasses`, and `issueID` variables.
212
+ - The `scriptID` variable is an alphanumeric string.
213
+ - The `issueClasses` variable is an object that classifies issues, such as the `issueClasses` object in a `tic` file.
214
+ - The `issueID` variables are strings, such as `'regionNoText'`, that name of properties of the `issueClasses` object.
215
+
216
+ The `script()` function of the `script` module generates a script and returns it as an object. The invoking module can further dispose of the script as needed.
217
+
218
+ ##### By a user
219
+
220
+ A user can invoke `script` in this way: In the Testilo project directory, execute the statement `node call script s c i0 i1 i2 i3 …`.
221
+
222
+ In this statement:
223
+ - Replace `s` with an ID for the script, such as `headings`.
224
+ - Replace `c` with the base name, such as `tic99`, of an issue classification file in the `score` subdirectory of the `process.env.FUNCTIONDIR` directory.
225
+ - Replace the remaining arguments (`i0` etc.) with issue IDs from that classification file.
226
+
227
+ The `call` module will retrieve the named classification from its directory.
228
+ The `script` module will create a script.
229
+ The `call` module will save the script as a JSON file in the `scripts` subdirectory of the `process.env.SPECDIR` directory.
230
+
231
+ #### Options
232
+
233
+ When the `script` module creates a script for you, it does not ask you for all of the options that the script may require. Instead, it chooses options. After you invoke `script`, you can edit the script that it creates to revise options.
234
+
192
235
  ### Merge
193
236
 
194
237
  Testilo merges batches with scripts, producing jobs, by means of the `merge` module.
@@ -324,49 +367,6 @@ The `call` module will save the jobs as JSON files in the `todo` subdirectory of
324
367
 
325
368
  To test the `merge` module, in the project directory you can execute the statement `node validation/merge/validate`. If `merge` is valid, all logging statements will begin with “Success” and none will begin with “ERROR”.
326
369
 
327
- ### Issues to script
328
-
329
- Testilo classifies issues. The built-in issue classifications are located in the `procs/score` directory, in files whose names begin with `tic` (for “Testilo issue classification”). You can create additional `tic` files with custom issue classifications.
330
-
331
- If you want Testaro to test targets for particular issues, you can name those issues and use the Testilo `script` module to create a script.
332
-
333
- #### Invocation
334
-
335
- There are two ways to use the `script` module.
336
-
337
- ##### By a module
338
-
339
- A module can invoke `script` in this way:
340
-
341
- ```javaScript
342
- const {script} = require('testilo/script');
343
- const scriptObj = script(scriptID, issueClasses, issueID0, issueID1, …);
344
- ```
345
-
346
- This invocation references `scriptID`, `issueClasses`, and `issueID` variables.
347
- - The `scriptID` variable is an alphanumeric string.
348
- - The `issueClasses` variable is an object that classifies issues, such as the `issueClasses` object in a `tic` file.
349
- - The `issueID` variables are strings, such as `'regionNoText'`, that name of properties of the `issueClasses` object.
350
-
351
- The `script()` function of the `script` module generates a script and returns it as an object. The invoking module can further dispose of the script as needed.
352
-
353
- ##### By a user
354
-
355
- A user can invoke `script` in this way: In the Testilo project directory, execute the statement `node call script s c i0 i1 i2 i3 …`.
356
-
357
- In this statement:
358
- - Replace `s` with an ID for the script, such as `headings`.
359
- - Replace `c` with the base name, such as `tic99`, of an issue classification file in the `score` subdirectory of the `process.env.FUNCTIONDIR` directory.
360
- - Replace the remaining arguments (`i0` etc.) with issue IDs from that classification file.
361
-
362
- The `call` module will retrieve the named classification from its directory.
363
- The `script` module will create a script.
364
- The `call` module will save the script as a JSON file in the `scripts` subdirectory of the `process.env.SPECDIR` directory.
365
-
366
- #### Options
367
-
368
- When the `script` module creates a script for you, it does not ask you for all of the options that the script may require. Instead, it chooses options. After you invoke `script`, you can edit the script that it creates to revise options.
369
-
370
370
  ## Report scoring
371
371
 
372
372
  ### Introduction
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testilo",
3
- "version": "12.0.2",
3
+ "version": "12.0.4",
4
4
  "description": "Client that scores and digests Testaro reports",
5
5
  "main": "aim.js",
6
6
  "scripts": {
package/script.js CHANGED
@@ -19,14 +19,11 @@ exports.script = (id, issueClasses, ... issueIDs) => {
19
19
  const neededTools = {};
20
20
  // For each specified issue:
21
21
  issueIDs.forEach(issueID => {
22
- console.log(`Processing ${issueID}`);
23
22
  // If it exists in the classification:
24
23
  const issueData = issueClasses[issueID];
25
24
  if (issueData) {
26
- console.log('It is in the classification');
27
25
  // For each tool that tests for the issue:
28
26
  const issueToolIDs = Object.keys(issueData.tools);
29
- console.log(`Tools with tests for it are ${issueToolIDs}`);
30
27
  issueToolIDs.forEach(issueToolID => {
31
28
  // For each of the tests of the tool for the issue:
32
29
  if (! neededTools[issueToolID]) {
@@ -91,6 +88,11 @@ exports.script = (id, issueClasses, ... issueIDs) => {
91
88
  which: toolID,
92
89
  rules: neededTools[toolID]
93
90
  };
91
+ // If the tool is Testaro:
92
+ if (toolID === 'testaro') {
93
+ // Prepend the inclusion option to the rule array.
94
+ toolAct.rules.unshift('y');
95
+ }
94
96
  // Add option specifications if necessary.
95
97
  if (toolID === 'axe') {
96
98
  toolAct.detailLevel = 2;