UNPKG

vitest-ctrf-json-reporter

Version:
39 lines (38 loc) 1.47 kB
import { type Awaitable, type File, type Reporter, type Vitest } from "vitest"; import { type CtrfReport, type CtrfEnvironment } from "../types/ctrf"; interface ReporterConfigOptions { outputFile?: string; outputDir?: string; minimal?: boolean; testType?: string; appName?: string | undefined; appVersion?: string | undefined; osPlatform?: string | undefined; osRelease?: string | undefined; osVersion?: string | undefined; buildName?: string | undefined; buildNumber?: string | undefined; buildUrl?: string | undefined; repositoryName?: string | undefined; repositoryUrl?: string | undefined; branchName?: string | undefined; testEnvironment?: string | undefined; } declare class GenerateCtrfReport implements Reporter { readonly ctrfReport: CtrfReport; readonly ctrfEnvironment: CtrfEnvironment; readonly reporterConfigOptions: ReporterConfigOptions; readonly reporterName = "vitest-ctrf-json-reporter"; readonly defaultOutputFile = "report.json"; readonly defaultOutputDir = "vitest-ctrf"; filename: string; constructor(config?: Partial<ReporterConfigOptions>); onInit(ctx: Vitest): Awaitable<void>; onFinished(files?: File[], errors?: unknown[]): Awaitable<void>; private updateCtrfTestResultsFromTestResult; private extractFailureDetails; private mapStatus; private writeReportToFile; private setFilename; } export default GenerateCtrfReport;