testaro 8.1.1 → 8.1.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/call.js +0 -1
  2. package/package.json +1 -1
  3. package/watch.js +17 -13
package/call.js CHANGED
@@ -39,7 +39,6 @@ const callWatch = async (isDirWatch, isForever, interval) => {
39
39
  `Starting a ${isForever === 'true' ? 'repeating' : 'one-time'} ${isDirWatch === 'true' ? 'directory' : 'network'} watch`
40
40
  );
41
41
  await cycle(isDirWatch === 'true', isForever === 'true', Number.parseInt(interval, 10));
42
- console.log('Watching ended');
43
42
  };
44
43
 
45
44
  // ########## OPERATION
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testaro",
3
- "version": "8.1.1",
3
+ "version": "8.1.2",
4
4
  "description": "Automation of accessibility testing",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/watch.js CHANGED
@@ -85,11 +85,11 @@ const checkNetJob = async () => {
85
85
  };
86
86
  // Writes a directory report.
87
87
  const writeDirReport = async report => {
88
- const scriptID = report && report.script && report.script.id;
89
- if (scriptID) {
88
+ const jobID = report && report.job && report.job.id;
89
+ if (jobID) {
90
90
  try {
91
91
  const reportJSON = JSON.stringify(report, null, 2);
92
- const reportName = `${scriptID}.json`;
92
+ const reportName = `${jobID}.json`;
93
93
  await fs.writeFile(`${reportDir}/${reportName}`, reportJSON);
94
94
  console.log(`Report ${reportName} saved`);
95
95
  return true;
@@ -99,6 +99,10 @@ const writeDirReport = async report => {
99
99
  return false;
100
100
  }
101
101
  }
102
+ else {
103
+ console.log('ERROR: Job has no ID');
104
+ return false;
105
+ }
102
106
  };
103
107
  // Submits a network report.
104
108
  const writeNetReport = async report => {
@@ -130,10 +134,10 @@ const writeNetReport = async report => {
130
134
  return ack;
131
135
  };
132
136
  // Archives a job.
133
- const archiveJob = async script => {
134
- const scriptJSON = JSON.stringify(script, null, 2);
135
- await fs.writeFile(`${doneDir}/${script.id}.json`, scriptJSON);
136
- await fs.rm(`${jobDir}/${script.id}.json`);
137
+ const archiveJob = async job => {
138
+ const jobJSON = JSON.stringify(job, null, 2);
139
+ await fs.writeFile(`${doneDir}/${job.id}.json`, jobJSON);
140
+ await fs.rm(`${jobDir}/${job.id}.json`);
137
141
  };
138
142
  // Waits.
139
143
  const wait = ms => {
@@ -144,15 +148,15 @@ const wait = ms => {
144
148
  });
145
149
  };
146
150
  // Runs a job and returns a report.
147
- exports.runJob = async (script, isDirWatch) => {
148
- const {id} = script;
151
+ exports.runJob = async (job, isDirWatch) => {
152
+ const {id} = job;
149
153
  if (id) {
150
154
  try {
151
155
  // Initialize a report.
152
156
  const report = {
153
- log: [],
154
- script,
155
- acts: []
157
+ job,
158
+ acts: [],
159
+ jobData: {}
156
160
  };
157
161
  // Run the job, adding to the report.
158
162
  await doJob(report);
@@ -218,7 +222,7 @@ exports.cycle = async (isDirWatch, isForever, interval) => {
218
222
  if (isDirWatch) {
219
223
  // Archive the job.
220
224
  await archiveJob(job);
221
- console.log(`Script ${job.id} archived`);
225
+ console.log(`Job ${job.id} archived`);
222
226
  }
223
227
  // If watching was specified for only 1 job, stop.
224
228
  statusOK = isForever;