alsatian-fluent-assertions
Version:
Fluent assertions extension to Alsatian xUnit framework.
40 lines (39 loc) • 2.41 kB
TypeScript
import { ISimpleMatcher } from "./i-simple-matcher";
import { EqType } from "../types/eq-types";
import { IFluentCore } from "./i-fluent-core";
import { INarrowableFluentCore } from "./i-narrowable-fluent-core";
import { Operators } from "./operators";
import { At, AssertionContext } from "../types";
export declare class SimpleMatcher<T, TNext, TPrev> extends Operators<T, TNext, TPrev> implements ISimpleMatcher<T, TNext, TPrev> {
constructor(actualValue: any, nextValue: any, initial: boolean, prevCore?: IFluentCore<any, any, any>, ctxt?: AssertionContext);
contains(expected: T, location?: At): IFluentCore<T, TNext, TPrev>;
strictlyEquals(expected: T): IFluentCore<T, TNext, TPrev>;
looselyEquals(expected: T): IFluentCore<T, TNext, TPrev>;
deeplyEquals(expected: T, eqType?: EqType.strictly | EqType.loosely): IFluentCore<T, TNext, TPrev>;
deepStrictlyEquals(expected: T): IFluentCore<T, TNext, TPrev>;
deepLooselyEquals(expected: T): IFluentCore<T, TNext, TPrev>;
isDefined(): IFluentCore<T, TNext, TPrev>;
isNull(): IFluentCore<T, TNext, TPrev>;
matches(matcher: RegExp): IFluentCore<string, TNext, TPrev>;
hasMatch(matcher: RegExp): INarrowableFluentCore<T, Array<string>, TPrev>;
throws(): INarrowableFluentCore<T, Error, TPrev>;
throwsAsync(): Promise<INarrowableFluentCore<T, Error, TPrev>>;
satisfies(predicate: (t: T) => boolean): IFluentCore<T, TNext, TPrev>;
is(expectedType: {
new (...args: Array<any>): any;
}): IFluentCore<T, TNext, TPrev>;
hasProperty<R>(expected: ((o: T) => R) | keyof T): INarrowableFluentCore<T, R, TPrev>;
hasSingle(): T extends Array<any> ? INarrowableFluentCore<T, T[0], TPrev> : void;
isEmpty(): IFluentCore<T, TNext, TPrev>;
isTruthy(): IFluentCore<T, TNext, TPrev>;
isFalsy(): IFluentCore<T, TNext, TPrev>;
converted<R>(lambda: (v: T) => R): IFluentCore<R, TNext, TPrev>;
protected _assertActualFunction(): void;
protected _assertBooly(val: boolean, name: string, expVal: string): IFluentCore<T, TNext, TPrev>;
protected _assertThrew<TError extends Error>(threw: Error, errorType: {
new (...args: Array<any>): TError;
}): void;
/** Convert to lib's deep equals. */
protected _deeplyEquals(actual: T, expected: T, eqType: EqType.strictly | EqType.loosely): boolean;
private _match(matcher);
}