Interface OneDoubleZero

One Double Zero, itself

interface OneDoubleZero {
    compare(coverageMap: CoverageMap, thresholds: Thresholds, perFile: boolean): {
        actual: number;
        expectation: number;
        fileName: null | string;
        thresholdType:
            | "branches"
            | "functions"
            | "lines"
            | "statements";
    }[];
    getCoverageMap(sourceFiles: string[], coverageFiles: string[], logLevel?: LogLevel): Promise<CoverageMap>;
    report(coverageMap: CoverageMap, reporters: Reporter[], outputDirectory: string, watermarks?: Watermarks): Promise<void>;
}

Methods

  • Compares a coverage map with an arbitrary set of thresholds.

    Parameters

    • coverageMap: CoverageMap

      The coverage map to compare

    • thresholds: Thresholds

      The thresholds to be compared to

    • perFile: boolean

      Whether the result should be returned per file or globally

    Returns {
        actual: number;
        expectation: number;
        fileName: null | string;
        thresholdType:
            | "branches"
            | "functions"
            | "lines"
            | "statements";
    }[]

  • Returns the coverage map for some source files, computed from the content of a coverage directory.

    Parameters

    • sourceFiles: string[]

      The source files to compute the coverage map for

    • coverageFiles: string[]

      The coverage data files to compute the coverage from

    • OptionallogLevel: LogLevel

      The level of information to log during the execution of the function

    Returns Promise<CoverageMap>

  • Reports a coverage map using some Istanbul reporters.

    Parameters

    • coverageMap: CoverageMap

      The coverage map to report

    • reporters: Reporter[]

      The list of reporters to use to report the coverage map

    • outputDirectory: string

      The directory where the reports will be output to

    • Optionalwatermarks: Watermarks

      The watermarks to apply to the reporters

    Returns Promise<void>