Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface TestContext

Different configuration options when running before each

Hierarchy

  • TestContext

Index

Properties

SANDBOX

SANDBOX: sinonType.SinonSandbox

The default sandbox is cleared out before each test run.

See sinon sandbox.

SANDBOXES

SANDBOXES: SandboxTypes

An object of different sandboxes. Used when needing to restore parts of the system for customized testing.

TEST_LOGGER

TEST_LOGGER: Logger

The test logger that is used when Logger.child is used anywhere. It uses memory logging.

configStubs

configStubs: object

An object used in tests that interact with config files.

Type declaration

fakeConnectionRequest

fakeConnectionRequest: function

Used to mock http request to Salesforce.

param

An HttpRequest.

param

Additional options.

See Connection.request

Type declaration

    • (request: AnyJson, options?: AnyJson): Promise<AnyJson>
    • Parameters

      • request: AnyJson
      • Optional options: AnyJson

      Returns Promise<AnyJson>

globalPathRetriever

globalPathRetriever: function

A function used when resolving the global path.

param

Unique id.

Type declaration

    • (uid: string): Promise<string>
    • Parameters

      • uid: string

      Returns Promise<string>

id

id: string

id A unique id for the test run.

localPathRetriever

localPathRetriever: function

A function used when resolving the local path.

param

Unique id.

Type declaration

    • (uid: string): Promise<string>
    • Parameters

      • uid: string

      Returns Promise<string>

rootPathRetriever

rootPathRetriever: function

A function used for resolving paths. Calls localPathRetriever and globalPathRetriever.

param

true if the config is global.

param

user id.

Type declaration

    • (isGlobal: boolean, uid?: undefined | string): Promise<string>
    • Parameters

      • isGlobal: boolean
      • Optional uid: undefined | string

      Returns Promise<string>

uniqid

uniqid: function

A function that returns unique strings.

Type declaration

    • (): string
    • Returns string

Methods

getConfigStubContents

  • getConfigStubContents(name: string, group?: undefined | string): ConfigContents
  • Gets a config stub contents by name.

    Parameters

    • name: string

      The name of the config.

    • Optional group: undefined | string

      If the config supports groups.

    Returns ConfigContents

setConfigStubContents

  • Sets a config stub contents by name

    Parameters

    • name: string

      The name of the config stub.

    • value: ConfigContents

      The actual stub contents. The Mock data.

    Returns void