alsatian
Version:
TypeScript and JavaScript testing framework for beautiful and readable tests
16 lines (15 loc) • 1.06 kB
TypeScript
import { ContainerMatcher, EmptyMatcher, FunctionMatcher, Matcher, NumberMatcher, PropertyMatcher, StringMatcher } from "../matchers";
import { FunctionSpy, PropertySpy } from "../spying";
import { AnyFunction } from "../_interfaces";
export interface IExpect {
<T>(actualValue: Array<T>): ContainerMatcher<Array<T>, T>;
<T extends AnyFunction>(actualValue: FunctionSpy | T): FunctionMatcher<T>;
(actualValue: number): NumberMatcher;
<T>(actualValue: PropertySpy<T>): PropertyMatcher<T>;
(actualValue: object): EmptyMatcher<object>;
(actualValue: string): StringMatcher;
<T>(actualValue: T): Matcher<T>;
fail(message: string): void;
extend<ExpectedType, MatcherType extends Matcher<ExpectedType>>(type: new (...args: Array<any>) => ExpectedType, matcher: new (value: ExpectedType, testItem: any) => MatcherType): IExtendedExpect<ExpectedType, MatcherType> & this;
}
export declare type IExtendedExpect<ExpectType, MatcherType extends Matcher<ExpectType>> = <T extends ExpectType>(actualValue: T) => Matcher<T> & MatcherType;