diff options
| -rw-r--r-- | src/formats.ts | 4 | ||||
| -rw-r--r-- | src/routes.ts | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/formats.ts b/src/formats.ts index ab118ab..63d5f60 100644 --- a/src/formats.ts +++ b/src/formats.ts @@ -6,6 +6,7 @@ export interface Format { // returns the coverage value as %: Number(90.0), Number(100.0), Number(89.5) parseCoverage: (file: Document) => CoverageResult; matchColor: (coverage: number, style: GradientStyle) => string; + fileName: string; } interface FormatList { @@ -70,7 +71,8 @@ const FormatsObj: FormatObj = { } return (100 * covered) / coverable; }, - matchColor: defaultColorMatches + matchColor: defaultColorMatches, + fileName: "index.html" } }, diff --git a/src/routes.ts b/src/routes.ts index be4380a..31bce07 100644 --- a/src/routes.ts +++ b/src/routes.ts @@ -102,7 +102,7 @@ export default (metadata: Metadata): Router => { // Write report and badge to directory await fs.promises.writeFile(path.join(reportPath, "badge.svg"), badge); await fs.promises.writeFile( - path.join(reportPath, "index.html"), + path.join(reportPath, formatter.fileName), contents ); |
