UNPKG

3.66 kBTypeScriptView Raw
1import { ArgCaptor1, ArgCaptor10, ArgCaptor2, ArgCaptor3, ArgCaptor4, ArgCaptor5, ArgCaptor6, ArgCaptor7, ArgCaptor8, ArgCaptor9 } from "./capture/ArgCaptor";
2import { MethodStubSetter } from "./MethodStubSetter";
3import { MethodStubVerificator } from "./MethodStubVerificator";
4export declare function spy<T>(instanceToSpy: T): T;
5export declare function mock<T>(clazz: (new (...args: any[]) => T) | (Function & {
6 prototype: T;
7})): T;
8export declare function mock<T>(clazz?: any): T;
9export declare function verify<T>(method: T): MethodStubVerificator<T>;
10export declare function when<T>(method: Promise<T>): MethodStubSetter<Promise<T>, T, Error>;
11export declare function when<T>(method: T): MethodStubSetter<T>;
12export declare function instance<T>(mockedValue: T): T;
13export declare function capture<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>(method: (a: T0, b: T1, c: T2, d: T3, e: T4, f: T5, g: T6, h: T7, i: T8, j: T9) => any): ArgCaptor10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>;
14export declare function capture<T0, T1, T2, T3, T4, T5, T6, T7, T8>(method: (a: T0, b: T1, c: T2, d: T3, e: T4, f: T5, g: T6, h: T7, i: T8) => any): ArgCaptor9<T0, T1, T2, T3, T4, T5, T6, T7, T8>;
15export declare function capture<T0, T1, T2, T3, T4, T5, T6, T7>(method: (a: T0, b: T1, c: T2, d: T3, e: T4, f: T5, g: T6, h: T7) => any): ArgCaptor8<T0, T1, T2, T3, T4, T5, T6, T7>;
16export declare function capture<T0, T1, T2, T3, T4, T5, T6>(method: (a: T0, b: T1, c: T2, d: T3, e: T4, f: T5, g: T6) => any): ArgCaptor7<T0, T1, T2, T3, T4, T5, T6>;
17export declare function capture<T0, T1, T2, T3, T4, T5>(method: (a: T0, b: T1, c: T2, d: T3, e: T4, f: T5) => any): ArgCaptor6<T0, T1, T2, T3, T4, T5>;
18export declare function capture<T0, T1, T2, T3, T4>(method: (a: T0, b: T1, c: T2, d: T3, e: T4) => any): ArgCaptor5<T0, T1, T2, T3, T4>;
19export declare function capture<T0, T1, T2, T3>(method: (a: T0, b: T1, c: T2, d: T3) => any): ArgCaptor4<T0, T1, T2, T3>;
20export declare function capture<T0, T1, T2>(method: (a: T0, b: T1, c: T2) => any): ArgCaptor3<T0, T1, T2>;
21export declare function capture<T0, T1>(method: (a: T0, b: T1) => any): ArgCaptor2<T0, T1>;
22export declare function capture<T0>(method: (a: T0) => any): ArgCaptor1<T0>;
23export declare function reset<T>(...mockedValues: T[]): void;
24export declare function resetCalls<T>(...mockedValues: T[]): void;
25export declare function anyOfClass<T>(expectedClass: new (...args: any[]) => T): any;
26export declare function anyFunction(): any;
27export declare function anyNumber(): any;
28export declare function anyString(): any;
29export declare function anything(): any;
30export declare function between(min: number, max: number): any;
31export declare function deepEqual<T>(expectedValue: T): T;
32export declare function notNull(): any;
33export declare function strictEqual(expectedValue: any): any;
34export declare function match(expectedValue: RegExp | string): any;
35export declare function objectContaining(expectedValue: Object): any;
36declare const _default: {
37 spy: typeof spy;
38 mock: typeof mock;
39 verify: typeof verify;
40 when: typeof when;
41 instance: typeof instance;
42 capture: typeof capture;
43 reset: typeof reset;
44 resetCalls: typeof resetCalls;
45 anyOfClass: typeof anyOfClass;
46 anyFunction: typeof anyFunction;
47 anyNumber: typeof anyNumber;
48 anyString: typeof anyString;
49 anything: typeof anything;
50 between: typeof between;
51 deepEqual: typeof deepEqual;
52 notNull: typeof notNull;
53 strictEqual: typeof strictEqual;
54 match: typeof match;
55 objectContaining: typeof objectContaining;
56};
57export default _default;