@testomatio/reporter
Version:
Testomatio Reporter Client
84 lines (83 loc) • 3.21 kB
TypeScript
export default CoveragePipe;
declare class CoveragePipe {
constructor(params: any, store: any);
id: string;
store: any;
branch: any;
isDefaultGitChanges: boolean;
isEnabled: boolean;
coverageFilePath: any;
isBranchDefault: boolean;
formattedDate: string;
title: string;
apiKey: string;
url: any;
client: Gaxios;
parsedCoverage: {};
changedFiles: any[];
matchedLines: Set<any>;
tests: Set<any>;
suiteIds: Set<any>;
tagLabels: Set<any>;
results: any[];
prepareRun(opts: any): Promise<any[]>;
addTest(data: any): void;
createRun(): Promise<void>;
updateRun(): void;
finishRun(runParams: any): Promise<void>;
sync(): Promise<void>;
toString(): string;
/**
* Retrieves the list of files changed in the current Git working directory
* compared to a specified branch.
*
* This method builds a Git diff command and attempts to retrieve the changed
* files using that command. It logs helpful information and errors during the process.
*
* If no changed files are found, or an error occurs at any stage, the method logs
* the issue and returns `undefined`.
*
* @returns {this | undefined} Returns the current instance (`this`) if changed files are found;
* otherwise, returns `undefined`.
*/
getGitChangedFiles(): this | undefined;
/**
* Validates the coverage file path (stored in `this.coverageFilePath`).
*
* This method checks:
* - That the file exists on disk.
* - That it is a regular file (not a directory or special file).
* - That it has a `.yml` extension to ensure it's a YAML file.
*
* Logs descriptive error messages for any failures.
*
* @returns {this | undefined} "true" in case if coverage file is valid and we can keep going;
* otherwise, `undefined`.
*/
validateCoverageFile(): this | undefined;
/**
* Parses the YAML coverage file (located at `this.coverageFilePath`) into a JavaScript object.
*
* - Reads the file content using UTF-8 encoding.
* - Parses it as YAML using the `yaml` library.
* - Stores the result in `this.parsedCoverage`.
* - If parsing fails, logs an error and returns `undefined`.
*
* @returns {this | undefined} The current parsed coverage yml file change lines, or "undefined" if parsing fails.
*/
parseCoverageFile(): this | undefined;
/**
* Extracts relevant test identifiers from changed files based on coverage mapping.
*
* Iterates over changed files and matches them against patterns in the parsed coverage data.
* For each match, it extracts test IDs or tags and stores them in corresponding sets:
* - Test IDs (starting with '@T' or '@S') are stored in `this.tests`
* - Tag labels (starting with 'tag:') are stored in `this.tagLabels`
* - Matched file paths are stored in `this.matchedLines`
*
* @returns {Promise <Set<string>>} A set of file paths that matched coverage patterns (`this.matchedLines`).
*/
extractRelevantTestsFromChanges(): Promise<Set<string>>;
#private;
}
import { Gaxios } from 'gaxios';