Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TestClient

The TestClient allows o simply mock an API request. You can set autoMock to save mocks from the API to the folder ./src/test/mocks

example

client = new TestClient(); client.autoMock(new BasicAuth('username', 'password', 'tenant')); service = new ApplicationService(client);

Hierarchy

  • TestClient

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

auth

client

client: FetchClient

mockAs

mockAs: string = ""

tenant

tenant: string = ""

Static mockAs

mockAs: string

Methods

autoMock

  • If set, the client tries to request mocking data from the API with the given authentication. Therefore the client looks up if it has a file locally with the given params+method=mockAs key. If yes, it simplz returns it. Otherwise it will contact the API and save it into a file.

    Parameters

    • auth: IAuthentication

      The authentication to use for mocking

    • Default value url: string = null

      The url to use (optional, if not set staging is used)

    Returns void

fetch

Generated using TypeDoc