Skip to content

Commit

Permalink
fix TS errors in report-generator
Browse files Browse the repository at this point in the history
  • Loading branch information
lukehesluke committed Feb 28, 2024
1 parent bade5dc commit ae13a92
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/openactive-integration-tests/test/report-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ class BaseReportGenerator {
},
"logsFor": (suite, type, options) => {
let first = true;
// @ts-expect-error this.logger is only defined in ReportGenerator
let logs = this.logger.logsFor(suite, type);
let ret = "";
for (let [i, value] of logs.entries()) {
Expand All @@ -140,6 +141,7 @@ class BaseReportGenerator {
return ret;
},
"statusFor": (suite) => {
// @ts-expect-error this.logger is only defined in ReportGenerator
let status = this.logger.statusFor(suite);
return status;
},
Expand All @@ -157,6 +159,9 @@ class BaseReportGenerator {
return {};
}

/**
* @returns {string}
*/
get reportHtmlPath () {
throw "Not Implemented";
}
Expand Down Expand Up @@ -192,7 +197,6 @@ class BaseReportGenerator {
converter.setOption('openLinksInNewWindow', true)
const html = converter.makeHtml(data);


await fs.writeFile(this.reportHtmlPath, html);
}

Expand Down Expand Up @@ -343,6 +347,7 @@ class LoggerGroup {

return this._opportunityTypeGroups = _
.chain(this.loggers)
// @ts-expect-error logger.opportunityType and logger.bookingFlow are only defined when a logger is loaded from an output JSON
.groupBy(logger => logger.opportunityType ? `${logger.bookingFlow} >> ${logger.opportunityType}` : "Generic")
.mapValues(group => new LoggerGroup(this.reporter, group))
.value();
Expand Down Expand Up @@ -394,7 +399,7 @@ class LoggerGroup {
acc[key] = (acc[key] || 0) + value;
}
return acc;
}, {});
}, /** @type {Record<string, number>} */({}));
}

get validationStatusCounts () {
Expand All @@ -405,7 +410,7 @@ class LoggerGroup {
acc[key] = (acc[key] || 0) + value;
}
return acc;
}, {});
}, /** @type {Record<string, number>} */({}));
}

get overallStatus () {
Expand Down

0 comments on commit ae13a92

Please sign in to comment.