testilo 7.0.4 → 7.0.5
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/call.js +4 -4
- package/package.json +1 -1
- package/score.js +1 -1
package/call.js
CHANGED
|
@@ -93,15 +93,15 @@ const callScore = async (scoreProcID, reportIDStart = '') => {
|
|
|
93
93
|
// If it exists:
|
|
94
94
|
if (rawReportName) {
|
|
95
95
|
// Score it.
|
|
96
|
-
const rawReportJSON = await fs.readFile(`${rawDir}/${rawReportName}
|
|
96
|
+
const rawReportJSON = await fs.readFile(`${rawDir}/${rawReportName}`, 'utf8');
|
|
97
97
|
const rawReport = JSON.parse(rawReportJSON);
|
|
98
98
|
const {scorer} = require(`${scoreProcDir}/${scoreProcID}.js`);
|
|
99
|
-
const scoredReport = score(scorer, rawReport);
|
|
99
|
+
const scoredReport = await score(scorer, rawReport);
|
|
100
100
|
// Save it, scored.
|
|
101
101
|
await fs.writeFile(
|
|
102
|
-
`${scoredDir}/${scoredReport.id}.json`, JSON.stringify(scoredReport, null, 2)
|
|
102
|
+
`${scoredDir}/${scoredReport.job.id}.json`, JSON.stringify(scoredReport, null, 2)
|
|
103
103
|
);
|
|
104
|
-
console.log(`
|
|
104
|
+
console.log(`Scored report ${rawReport.job.id} saved in ${scoredDir}`);
|
|
105
105
|
}
|
|
106
106
|
// Otherwise, i.e. if it does not exist:
|
|
107
107
|
else {
|
package/package.json
CHANGED
package/score.js
CHANGED
|
@@ -14,6 +14,6 @@ exports.score = async (scoreProc, rawReport) => {
|
|
|
14
14
|
const scoredReport = JSON.parse(JSON.stringify(rawReport));
|
|
15
15
|
// Score it.
|
|
16
16
|
await scoreProc(scoredReport);
|
|
17
|
-
console.log(`Report ${rawReport.id} scored`);
|
|
17
|
+
console.log(`Report ${rawReport.job.id} scored`);
|
|
18
18
|
return scoredReport;
|
|
19
19
|
};
|