testaro 6.0.1 → 6.0.3

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/commands.js +2 -1
  2. package/package.json +1 -1
  3. package/watch.js +18 -13
package/commands.js CHANGED
@@ -139,7 +139,8 @@ exports.commands = {
139
139
  'Navigate to a new URL',
140
140
  {
141
141
  which: [true, 'string', 'isURL', 'URL'],
142
- what: [false, 'string', 'hasLength', 'comment']
142
+ what: [false, 'string', 'hasLength', 'comment'],
143
+ id: [false, 'string', 'hasLength', 'ID of the host']
143
144
  }
144
145
  ],
145
146
  wait: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testaro",
3
- "version": "6.0.1",
3
+ "version": "6.0.3",
4
4
  "description": "Automation of accessibility testing",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/watch.js CHANGED
@@ -37,22 +37,27 @@ const reportDir = process.env.REPORTDIR;
37
37
 
38
38
  // Checks for a directory job.
39
39
  const checkDirJob = async () => {
40
- const jobDirFileNames = await fs.readdir(watchDir);
41
- const jobFileNames = jobDirFileNames.filter(fileName => fileName.endsWith('.json'));
42
- if (jobFileNames.length) {
43
- const scriptJSON = await fs.readFile(`${watchDir}/${jobFileNames[0]}`, 'utf8');
44
- try {
45
- const script = JSON.parse(scriptJSON, null, 2);
46
- return script;
40
+ try {
41
+ const jobDirFileNames = await fs.readdir(watchDir);
42
+ const jobFileNames = jobDirFileNames.filter(fileName => fileName.endsWith('.json'));
43
+ if (jobFileNames.length) {
44
+ const scriptJSON = await fs.readFile(`${watchDir}/${jobFileNames[0]}`, 'utf8');
45
+ try {
46
+ const script = JSON.parse(scriptJSON, null, 2);
47
+ return script;
48
+ }
49
+ catch(error) {
50
+ return {
51
+ error: 'ERROR: Script was not JSON',
52
+ message: error.message
53
+ };
54
+ }
47
55
  }
48
- catch(error) {
49
- return {
50
- error: 'ERROR: Script was not JSON',
51
- message: error.message
52
- };
56
+ else {
57
+ return {};
53
58
  }
54
59
  }
55
- else {
60
+ catch {
56
61
  return {};
57
62
  }
58
63
  };