Mock user-agent class.

Hierarchy

Constructors

Properties

baseURL: undefined | string | URL

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

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.

Methods

  • Returns Promise<void>

  • Parameters

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

    Returns FormData

  • Destroy all active keep-alive connections.

    Returns Promise<void>

  • Start mock server.

    Parameters

    Returns Promise<MockUserAgent>

  • Stop mock server.

    Returns Promise<void>

Generated using TypeDoc