UNPKG

854 BTypeScriptView Raw
1import { FunctionSpy } from "../spying";
2import { FunctionSpyMatcher } from "./function-spy-matcher";
3import { Matcher } from "./matcher";
4import { AnyFunction } from "../_interfaces";
5export declare class FunctionMatcher<T extends AnyFunction> extends Matcher<FunctionSpy | T> {
6 toThrow(): void;
7 toThrowAsync(): Promise<void>;
8 toThrowError(errorType: new (...args: Array<any>) => Error, errorMessage: string): void;
9 toThrowErrorAsync(errorType: new (...args: Array<any>) => Error, errorMessage: string): Promise<void>;
10 toHaveBeenCalled(): FunctionSpyMatcher;
11 toHaveBeenCalledWith(...expectedArguments: Parameters<T>): FunctionSpyMatcher;
12 private _stringifyArguments;
13 private _getError;
14 private _getAsyncError;
15 private _errorMatches;
16 private _callArgumentsMatch;
17 private _isFunctionSpyOrSpiedOnFunction;
18}