Constructors

Properties

handlers: {
    [method: string]: undefined | any[];
} = {}
history: {
    [method: string]: undefined | XiorRequestConfig<any>[];
} = {}

Methods

  • Parameters

    • method: string

    Returns ((matcher?: string | RegExp, options?: XiorRequestConfig<any>) => {
        passThrough: (() => default);
        reply: ((code: StatusOrCallback, responseData?: any, responseHeaders?: MockHeaders) => default);
        replyOnce: ((code: StatusOrCallback, responseData?: any, responseHeaders?: MockHeaders) => default);
        withDelayInMs: ((delay: number) => ((code: StatusOrCallback, responseData?: any, responseHeaders?: MockHeaders) => default));
        abortRequest(): default;
        abortRequestOnce(): default;
        networkError(): default;
        networkErrorOnce(): default;
        timeout(): default;
        timeoutOnce(): default;
    })

      • (matcher?, options?): {
            passThrough: (() => default);
            reply: ((code: StatusOrCallback, responseData?: any, responseHeaders?: MockHeaders) => default);
            replyOnce: ((code: StatusOrCallback, responseData?: any, responseHeaders?: MockHeaders) => default);
            withDelayInMs: ((delay: number) => ((code: StatusOrCallback, responseData?: any, responseHeaders?: MockHeaders) => default));
            abortRequest(): default;
            abortRequestOnce(): default;
            networkError(): default;
            networkErrorOnce(): default;
            timeout(): default;
            timeoutOnce(): default;
        }
      • Parameters

        Returns {
            passThrough: (() => default);
            reply: ((code: StatusOrCallback, responseData?: any, responseHeaders?: MockHeaders) => default);
            replyOnce: ((code: StatusOrCallback, responseData?: any, responseHeaders?: MockHeaders) => default);
            withDelayInMs: ((delay: number) => ((code: StatusOrCallback, responseData?: any, responseHeaders?: MockHeaders) => default));
            abortRequest(): default;
            abortRequestOnce(): default;
            networkError(): default;
            networkErrorOnce(): default;
            timeout(): default;
            timeoutOnce(): default;
        }

  • Type Parameters

    • T extends unknown

    Parameters

    • Optionalmatcher: string | RegExp
    • Optionaloptions: RequestOptions

    Returns {
        passThrough: (() => default);
        reply: ((code: StatusOrCallback, responseData?: any, responseHeaders?: MockHeaders) => default);
        replyOnce: ((code: StatusOrCallback, responseData?: any, responseHeaders?: MockHeaders) => default);
        withDelayInMs: ((delay: number) => ((code: StatusOrCallback, responseData?: any, responseHeaders?: MockHeaders) => default));
        abortRequest(): default;
        abortRequestOnce(): default;
        networkError(): default;
        networkErrorOnce(): default;
        timeout(): default;
        timeoutOnce(): default;
    }

  • Type Parameters

    • T extends unknown

    Parameters

    • Optionalmatcher: string | RegExp
    • Optionaloptions: RequestOptions

    Returns {
        passThrough: (() => default);
        reply: ((code: StatusOrCallback, responseData?: any, responseHeaders?: MockHeaders) => default);
        replyOnce: ((code: StatusOrCallback, responseData?: any, responseHeaders?: MockHeaders) => default);
        withDelayInMs: ((delay: number) => ((code: StatusOrCallback, responseData?: any, responseHeaders?: MockHeaders) => default));
        abortRequest(): default;
        abortRequestOnce(): default;
        networkError(): default;
        networkErrorOnce(): default;
        timeout(): default;
        timeoutOnce(): default;
    }

  • Type Parameters

    • T extends unknown

    Parameters

    • Optionalmatcher: string | RegExp
    • Optionaloptions: RequestOptions

    Returns {
        passThrough: (() => default);
        reply: ((code: StatusOrCallback, responseData?: any, responseHeaders?: MockHeaders) => default);
        replyOnce: ((code: StatusOrCallback, responseData?: any, responseHeaders?: MockHeaders) => default);
        withDelayInMs: ((delay: number) => ((code: StatusOrCallback, responseData?: any, responseHeaders?: MockHeaders) => default));
        abortRequest(): default;
        abortRequestOnce(): default;
        networkError(): default;
        networkErrorOnce(): default;
        timeout(): default;
        timeoutOnce(): default;
    }

  • Type Parameters

    • T extends unknown

    Parameters

    • Optionalmatcher: string | RegExp
    • Optionaloptions: RequestOptions

    Returns {
        passThrough: (() => default);
        reply: ((code: StatusOrCallback, responseData?: any, responseHeaders?: MockHeaders) => default);
        replyOnce: ((code: StatusOrCallback, responseData?: any, responseHeaders?: MockHeaders) => default);
        withDelayInMs: ((delay: number) => ((code: StatusOrCallback, responseData?: any, responseHeaders?: MockHeaders) => default));
        abortRequest(): default;
        abortRequestOnce(): default;
        networkError(): default;
        networkErrorOnce(): default;
        timeout(): default;
        timeoutOnce(): default;
    }

  • Type Parameters

    • T extends unknown

    Parameters

    • Optionalmatcher: string | RegExp
    • Optionaloptions: RequestOptions

    Returns {
        passThrough: (() => default);
        reply: ((code: StatusOrCallback, responseData?: any, responseHeaders?: MockHeaders) => default);
        replyOnce: ((code: StatusOrCallback, responseData?: any, responseHeaders?: MockHeaders) => default);
        withDelayInMs: ((delay: number) => ((code: StatusOrCallback, responseData?: any, responseHeaders?: MockHeaders) => default));
        abortRequest(): default;
        abortRequestOnce(): default;
        networkError(): default;
        networkErrorOnce(): default;
        timeout(): default;
        timeoutOnce(): default;
    }

  • Type Parameters

    • T extends unknown

    Parameters

    • Optionalmatcher: string | RegExp
    • Optionaldata: RequestData<T>
    • Optionaloptions: RequestOptions

    Returns {
        passThrough: (() => default);
        reply: ((code: StatusOrCallback, responseData?: any, responseHeaders?: MockHeaders) => default);
        replyOnce: ((code: StatusOrCallback, responseData?: any, responseHeaders?: MockHeaders) => default);
        withDelayInMs: ((delay: number) => ((code: StatusOrCallback, responseData?: any, responseHeaders?: MockHeaders) => default));
        abortRequest(): default;
        abortRequestOnce(): default;
        networkError(): default;
        networkErrorOnce(): default;
        timeout(): default;
        timeoutOnce(): default;
    }

  • Type Parameters

    • T extends unknown

    Parameters

    • Optionalmatcher: string | RegExp
    • Optionaldata: RequestData<T>
    • Optionaloptions: RequestOptions

    Returns {
        passThrough: (() => default);
        reply: ((code: StatusOrCallback, responseData?: any, responseHeaders?: MockHeaders) => default);
        replyOnce: ((code: StatusOrCallback, responseData?: any, responseHeaders?: MockHeaders) => default);
        withDelayInMs: ((delay: number) => ((code: StatusOrCallback, responseData?: any, responseHeaders?: MockHeaders) => default));
        abortRequest(): default;
        abortRequestOnce(): default;
        networkError(): default;
        networkErrorOnce(): default;
        timeout(): default;
        timeoutOnce(): default;
    }

  • Type Parameters

    • T extends unknown

    Parameters

    • Optionalmatcher: string | RegExp
    • Optionaldata: RequestData<T>
    • Optionaloptions: RequestOptions

    Returns {
        passThrough: (() => default);
        reply: ((code: StatusOrCallback, responseData?: any, responseHeaders?: MockHeaders) => default);
        replyOnce: ((code: StatusOrCallback, responseData?: any, responseHeaders?: MockHeaders) => default);
        withDelayInMs: ((delay: number) => ((code: StatusOrCallback, responseData?: any, responseHeaders?: MockHeaders) => default));
        abortRequest(): default;
        abortRequestOnce(): default;
        networkError(): default;
        networkErrorOnce(): default;
        timeout(): default;
        timeoutOnce(): default;
    }