@contract-case/case-plugin-base
Version:
Plugin framework for writing plugins for the ContractCase test framework
51 lines • 1.82 kB
TypeScript
import type { CaseError, MatchResult } from '../types';
/**
* Combines multiple {@link MatchResult} objects / Promises containing match results.
* @public
*
* @param results - MatchResult or `Promise<MatchResult>` objects
* @returns a Promise containing the combined Match Results.
*/
export declare const combineResultPromises: (...results: (MatchResult | Promise<MatchResult>)[]) => Promise<MatchResult>;
/**
* Combines multiple {@link MatchResult} objects into one match result object
* @public
*
* @deprecated Prefer {@link combineResultPromises}
*
* @param results - MatchResult or `Promise<MatchResult>` objects
* @returns combined Match Results.
*/
export declare const combineResults: (...results: MatchResult[]) => MatchResult;
/**
* Makes a {@link MatchResult} object.
* @public
*
* @param err - any {@link CaseError} objects. If none supplied, then it makes a passing {@link MatchResult} object
* @returns a {@link MatchResult} object.
*/
export declare const makeResults: (...err: CaseError[]) => MatchResult;
/**
* Makes a passing {@link MatchResult} object.
* @public
*
* @returns a {@link MatchResult} object that has no errors.
*/
export declare const makeNoErrorResult: () => MatchResult;
/**
* Tests whether a given {@link MatchResult} object has any errors.
* @public
*
* @param result - a {@link MatchResult} object
* @returns true if `result` has any errors
*/
export declare const hasErrors: (result: MatchResult | CaseError[]) => boolean;
/**
* Tests whether a given {@link MatchResult} object has no errors.
* @public
*
* @param result - a {@link MatchResult} object
* @returns true if `result` has no errors (ie, is a passing {@link MatchResult})
*/
export declare const hasNoErrors: (result: MatchResult) => boolean;
//# sourceMappingURL=results.d.ts.map