MockInterceptor options.

interface Options {
    body?: string | RegExp | ((body) => boolean);
    headers?: Record<string, string | RegExp | ((body) => boolean)> | ((headers) => boolean);
    method?: string | RegExp | ((method) => boolean);
    path: string | RegExp | ((path) => boolean);
    query?: Record<string, any>;
}

Hierarchy (view full)

Properties

body?: string | RegExp | ((body) => boolean)

Body to intercept on.

Type declaration

    • (body): boolean
    • Parameters

      • body: string

      Returns boolean

headers?: Record<string, string | RegExp | ((body) => boolean)> | ((headers) => boolean)

Headers to intercept on.

Type declaration

    • (headers): boolean
    • Parameters

      • headers: Record<string, string>

      Returns boolean

method?: string | RegExp | ((method) => boolean)

Method to intercept on. Defaults to GET.

Type declaration

    • (method): boolean
    • Parameters

      • method: string

      Returns boolean

path: string | RegExp | ((path) => boolean)

Path to intercept on.

Type declaration

    • (path): boolean
    • Parameters

      • path: string

      Returns boolean

query?: Record<string, any>

Query params to intercept on