@ply-ct/ply
Version:
REST API Automated Testing
44 lines (43 loc) • 1.02 kB
TypeScript
import { CodeLine } from './code';
import { Log } from './log';
import { Values } from './values';
/**
* jsdiff object
*/
export declare type Diff = {
added?: boolean;
removed?: boolean;
ignored?: boolean;
value: string;
count: number;
};
export declare type Marker = {
start: number;
end: number;
ignored?: boolean;
};
export declare class Compare {
readonly logger: Log;
constructor(logger: Log);
/**
* Diff results always contain \n newlines
*/
diffLines(expected: string, actual: string, values: Values, trusted?: boolean): Diff[];
/**
* Diffs always have \n newlines
*/
private convertToJsDiff;
/**
* Handles regex and @request/@response.
*/
private markIgnored;
/**
* Used by ply-ui
*/
mirrorDiffs(diffs: Diff[]): Diff[];
/**
* Used by ply-ui
*/
markLines(start: number, lines: string[], ignored: boolean): Marker[];
getMarkers(diffs: Diff[], lines: CodeLine[]): Marker[];
}