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[], processCoverage: ProcessCoverage, logLevel?: LogLevel, ignoreUnhitSourceFiles?: boolean): 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";
    }[]

  • From a process coverage, returns the coverage map of an arbitrary set of source files.

    Parameters

    • sourceFiles: string[]

      The source files to get the coverage map for

    • processCoverage: ProcessCoverage

      The process coverage to get the coverage map from

    • OptionallogLevel: LogLevel

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

    • OptionalignoreUnhitSourceFiles: boolean

      Whether unhit source files should be ignored or not

    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>