earljs
Version:
Ergonomic, modern and type-safe assertion library
19 lines (18 loc) • 575 B
TypeScript
export interface ValidationResult {
success: boolean;
hint?: string;
reason: string;
negatedReason: string;
actual?: string;
expected?: string;
}
export declare class Control<T> {
actual: T;
isNegated: boolean;
private extraMessage?;
testRunnerCtx: import("./test-runners").TestRunnerCtx | undefined;
private stack;
constructor(actual: T, isNegated: boolean, extraMessage?: string | undefined);
assert: (result: ValidationResult) => void;
fail: (result: Omit<ValidationResult, 'success' | 'negatedReason'>) => never;
}