testilo 3.1.3 → 3.3.1

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/score.js CHANGED
@@ -1,6 +1,7 @@
1
1
  /*
2
2
  score.js
3
3
  Testilo scoring script.
4
+ Usage example: node score 35k1r-railpass sp10a
4
5
  */
5
6
 
6
7
  // ########## IMPORTS
@@ -8,7 +9,7 @@
8
9
  // Module to keep secrets.
9
10
  require('dotenv').config();
10
11
  // Module to read and write files.
11
- const fs = require('fs').promises;
12
+ const fs = require('fs/promises');
12
13
 
13
14
  // ########## CONSTANTS
14
15
 
@@ -32,7 +33,7 @@ const score = async () => {
32
33
  scorer(report);
33
34
  report.score.scoreProcID = scoreProcID;
34
35
  const scoredReportJSON = JSON.stringify(report, null, 2);
35
- await fs.writeFile(`${__dirname}/${reportDirScored}/${fileName}`, scoredReportJSON);
36
+ await fs.writeFile(`${__dirname}/${reportDirScored}/${fileName}`, `${scoredReportJSON}\n`);
36
37
  console.log(`Report ${fileName.slice(0, -5)} scored and saved`);
37
38
  };
38
39
  };