Test user-agent class.

Hierarchy

Constructors

Properties

_assert: undefined | Omit<typeof assert, "strict" | "ok" | "equal" | "notEqual" | "deepEqual" | "notDeepEqual" | "strictEqual" | "deepStrictEqual" | "ifError"> & {
    deepEqual: (<T>(actual, expected, message?) => asserts actual is T);
    deepStrictEqual: (<T>(actual, expected, message?) => asserts actual is T);
    equal: (<T>(actual, expected, message?) => asserts actual is T);
    ifError: ((value) => asserts value is undefined | null);
    notDeepEqual: ((actual, expected, message?) => void);
    notEqual: ((actual, expected, message?) => void);
    ok: ((value, message?) => asserts value);
    strict: Omit<typeof assert, "strict" | "ok" | "equal" | "notEqual" | "deepEqual" | "notDeepEqual" | "strictEqual" | "deepStrictEqual" | "ifError"> & ({ (value: unknown, message?: string | Error | undefined): asserts value; equal: <T>(actual: unknown, expected: T, message?: string | Error | undefined) => asserts actual is T; notEqual: (actual: unknown, expected: unknown, message?: string | Error | undefined) => void; deepEqual: <T>(actual: unknown, expected: T, message?: string | Error | undefined) => asserts actual is T; notDeepEqual: (actual: unknown, expected: unknown, message?: string | Error | undefined) => void; ok: (value: unknown, message?: string | Error | undefined) => asserts value; strictEqual: <T>(actual: unknown, expected: T, message?: string | Error | undefined) => asserts actual is T; deepStrictEqual: <T>(actual: unknown, expected: T, message?: string | Error | undefined) => asserts actual is T; ifError: (value: unknown) => asserts value is null | undefined; strict: Omit<typeof assert, "strict" | "ok" | "equal" | "notEqual" | "deepEqual" | "notDeepEqual" | "strictEqual" | "deepStrictEqual" | "ifError"> & any; });
    strictEqual: (<T>(actual, expected, message?) => asserts actual is T);
    (value, message?): asserts value;
} | Test<BuiltPlugins, TestOpts> = undefined
_dom: undefined | default = undefined
_finished: undefined | null | [number, string] = undefined
_messages: undefined | AsyncIterableIterator<JSONValue> = undefined
_res: undefined | UserAgentResponse = undefined
_stack: StackUtils = ...
_ws: undefined | WebSocket = undefined
baseURL: undefined | string | URL

Base URL to be used to resolve all relative request URLs with.

body: Buffer = ...

Current HTTP response content.

cookieJar: null | CookieJar = ...

Cookie jar to use.

hooks: AsyncHooks = ...

User-agent hooks.

httpTransport: HTTPTransport = ...

Transport backend to perform HTTP requests with.

httpsTransport: HTTPSTransport = ...

Transport backend to perform HTTPS requests with.

maxRedirects: number

Maximum number of redirects to follow, default to 0.

name: undefined | string

Name of user-agent to send with User-Agent header.

server: undefined | Server = undefined

Server to use for mock requests.

wsTransport: WSTransport = ...

Transport backend to use for WebSocket connections.

Accessors

  • get _html(): default
  • Returns default

  • get ws(): WebSocket
  • Active WebSocket connection.

    Returns WebSocket

Methods

  • Returns Promise<void>

  • Parameters

    • values: Record<string, string | Upload> = {}

    Returns FormData

  • Parameters

    • tap: Test<BuiltPlugins, TestOpts>

    Returns void

  • Returns Promise<void>

  • Delegate assertion to test framework currently in use.

    Parameters

    • name: string
    • args: any[]
    • msg: string
    • skip: SkipFunction

    Returns void

  • Check response content for exact match.

    Parameters

    • body: string

    Returns TestUserAgent

  • Opposite of bodyIs.

    Parameters

    • body: string

    Returns TestUserAgent

  • Check response content for similar match.

    Parameters

    • regex: RegExp

    Returns TestUserAgent

  • Opposite of bodyLike.

    Parameters

    • regex: RegExp

    Returns TestUserAgent

  • Close WebSocket connection gracefully.

    Parameters

    • code: number
    • reason: string

    Returns Promise<void>

  • Wait for WebSocket connection to be closed gracefully and check status.

    Parameters

    • code: number

    Returns Promise<void>

  • Perform a DELETE request and check for transport errors.

    Parameters

    Returns Promise<TestUserAgent>

  • Destroy all active keep-alive connections.

    Returns Promise<void>

  • Checks for existence of the CSS selectors first matching HTML/XML element.

    Parameters

    • selector: string

    Returns TestUserAgent

  • Opposite of elementExists.

    Parameters

    • selector: string

    Returns TestUserAgent

  • Perform a GET request and check for transport errors.

    Parameters

    Returns Promise<TestUserAgent>

  • Perform a HEAD request and check for transport errors.

    Parameters

    Returns Promise<TestUserAgent>

  • Check if response header exists.

    Parameters

    • name: string

    Returns TestUserAgent

  • Opposite of headerExists.

    Parameters

    • name: string

    Returns TestUserAgent

  • Check response header for exact match.

    Parameters

    • name: string
    • value: string

    Returns TestUserAgent

  • Opposite of headerIs.

    Parameters

    • name: string
    • value: string

    Returns TestUserAgent

  • Check response header for similar match.

    Parameters

    • name: string
    • regex: RegExp

    Returns TestUserAgent

  • Check if JSON response contains a value that can be identified using the given JSON Pointer.

    Parameters

    • pointer: string

    Returns TestUserAgent

  • Check the value extracted from JSON response using the given JSON Pointerr, which defaults to the root value if it is omitted.

    Parameters

    Returns TestUserAgent

  • Wait for next WebSocket message to arrive.

    Returns Promise<JSONValue>

  • Perform a OPTIONS request and check for transport errors.

    Parameters

    Returns Promise<TestUserAgent>

  • Perform a PATCH request and check for transport errors.

    Parameters

    Returns Promise<TestUserAgent>

  • Perform a POST request and check for transport errors.

    Parameters

    Returns Promise<TestUserAgent>

  • Perform a PUT request and check for transport errors.

    Parameters

    Returns Promise<TestUserAgent>

  • Send message or frame via WebSocket.

    Parameters

    • message: any

    Returns Promise<void>

  • Check response status for exact match.

    Parameters

    • status: number

    Returns TestUserAgent

  • Stop mock server.

    Returns Promise<void>

  • Checks text content of the CSS selectors first matching HTML/XML element for similar match.

    Parameters

    • selector: string
    • regex: RegExp

    Returns TestUserAgent

  • Checks text content of the CSS selectors first matching HTML/XML element for no match.

    Parameters

    • selector: string
    • regex: RegExp

    Returns TestUserAgent

  • Check response Content-Type header for exact match.

    Parameters

    • value: string

    Returns TestUserAgent

  • Check response Content-Type header for similar match.

    Parameters

    • regex: RegExp

    Returns TestUserAgent

  • Open a WebSocket connection with transparent handshake.

    Parameters

    Returns Promise<void>

  • Check if YAML response contains a value that can be identified using the given JSON Pointer.

    Parameters

    • pointer: string

    Returns TestUserAgent

  • Check the value extracted from YAML response using the given JSON Pointerr, which defaults to the root value if it is omitted.

    Parameters

    Returns TestUserAgent

Generated using TypeDoc