archunit
Version:
ArchUnit TypeScript is an architecture testing library, to specify and assert architecture rules in your TypeScript app
24 lines (23 loc) • 1.07 kB
TypeScript
import { Violation, EmptyTestViolation } from '../../common/assertion';
import { MetricComparison } from './types';
import { MetricResult } from '../projection';
import { Filter } from '../../common';
/**
* Represents a class that violates a metric threshold
*/
export declare class MetricViolation implements Violation {
readonly className: string;
readonly filePath: string;
readonly metricName: string;
readonly metricValue: number;
readonly threshold: number;
readonly comparison: MetricComparison;
constructor(className: string, filePath: string, metricName: string, metricValue: number, threshold: number, comparison: MetricComparison);
toString(): string;
}
/**
* Gathers violations from pre-computed metric results
* @param metricResults The metric results to check for violations
* @param allowEmptyTests Whether to allow empty tests (when no files match)
*/
export declare function gatherMetricViolations(metricResults: MetricResult[], allowEmptyTests?: boolean, filters?: Filter[]): (MetricViolation | EmptyTestViolation)[];