testilo 2.0.0 → 2.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.
Files changed (3) hide show
  1. package/README.md +8 -0
  2. package/index.js +5 -4
  3. package/package.json +2 -1
package/README.md CHANGED
@@ -9,6 +9,8 @@ This application is designed to be installed on a Windows or Macintosh host and
9
9
 
10
10
  ## Dependencies
11
11
 
12
+ The `dotenv` dependency lets you set environment variables in an untracked `.env` file.
13
+
12
14
  The Testaro dependency has some dependencies in the @siteimprove scope that are Github Packages. In order to execute `npm install` successfully, you need the `.npmrc` file in your project directory with this content, unless an `.npmrc` file in your home directory or elsewhere provides the same content:
13
15
 
14
16
  ```bash
@@ -83,3 +85,9 @@ Testaro delivers its results by populating the `log` and `acts` arrays of the ob
83
85
  ### `ibm` test
84
86
 
85
87
  Testaro can perform the `ibm` test. That test requires the `aceconfig.js` configuration file in the root directory of the Testilo project.
88
+
89
+ ### Environment variables
90
+
91
+ If a `wave` test is included in a script, an environment variable named `TESTARO_WAVE_KEY` must exist, with your WAVE API key as its value.
92
+
93
+ Before executing a Testaro script, you can optionally also set the environment variables `TESTARO_DEBUG` (to `'true'` or anything else) and/or `TESTARO_WAITS` (to a non-negative integer). The effects of these variables are described in the Testaro `index.js` file.
package/index.js CHANGED
@@ -8,6 +8,7 @@
8
8
  // Module to perform tests.
9
9
  const {handleRequest} = require('testaro');
10
10
  const fs = require('fs').promises;
11
+ require('dotenv').config();
11
12
 
12
13
  // ########## FUNCTIONS
13
14
 
@@ -44,16 +45,16 @@ const callTestaro = async (id, script) => {
44
45
  };
45
46
  // Runs a job.
46
47
  const run = async () => {
47
- const scriptName = process.argv[2];
48
+ const scriptID = process.argv[2];
48
49
  const batchName = process.argv[3];
49
- if (scriptName) {
50
+ if (scriptID) {
50
51
  try {
51
- const scriptJSON = await fs.readFile(`scripts/${scriptName}.json`, 'utf8');
52
+ const scriptJSON = await fs.readFile(`scripts/${scriptID}.json`, 'utf8');
52
53
  const script = JSON.parse(scriptJSON);
53
- let batch = null;
54
54
  // Identify the start time and a timestamp.
55
55
  const timeStamp = Math.floor((Date.now() - Date.UTC(2022, 1)) / 2000).toString(36);
56
56
  // If there is a batch:
57
+ let batch = null;
57
58
  if (batchName) {
58
59
  // Convert the script to a batch-based set of scripts.
59
60
  const batchJSON = await fs.readFile(`batches/${batchName}.json`, 'utf8');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testilo",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "description": "Client that runs Testaro tests to fulfill Aorta jobs",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -18,6 +18,7 @@
18
18
  },
19
19
  "homepage": "https://github.com/jrpool/testilo",
20
20
  "dependencies": {
21
+ "dotenv": "*",
21
22
  "testaro": "*"
22
23
  },
23
24
  "devDependencies": {